Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 1. Introduction.

Slides:



Advertisements
Similar presentations
Back to Sorting – More efficient sorting algorithms.
Advertisements

1 CS101 Introduction to Computing Lecture 17 Algorithms II.
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Software Engineering and Design Principles Chapter 1.
CSCE 210 Data Structures and Algorithms
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Unit 171 Algorithms and Problem Solving  Introduction  Algorithm Design  Algorithm Properties  Algorithm Control Flow  Examples  Comparing Algorithms.
Software Engineering Principles and C++ Classes
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 5. Recursive Algorithms.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++
Topic 4 – Programmer- Defined Functions. CISC 105 – Topic 4 Functions So far, we have only seen programs with one function, main. These programs begin.
1 Design and Analysis of Algorithms تصميم وتحليل الخوارزميات (311 عال) Chapter 1 Introduction to Algorithms.
ALGORITHM ANALYSIS AND DESIGN INTRODUCTION TO ALGORITHMS CS 413 Divide and Conquer Algortihms: Binary search, merge sort.
Sort an array - the selection sort algorithm. Selection Sort Selection sort a classic computer algorithm that is used to sort an array The selection sort.
Chapter 2.1 Program Design and Documentation. Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented.
 Introduction Introduction  Types of Function Types of Function  Library function Library function  User defined function User defined function 
Problem Solving and Algorithms
Recursion l Powerful Tool l Useful in simplifying a problem (hides details of a problem) l The ability of a function to call itself l A recursive call.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Chapter 12 Recursion, Complexity, and Searching and Sorting
Chapter 06 (Part I) Functions and an Introduction to Recursion.
CSE 219 Computer Science III Program Design Principles.
Introduction to Algorithms By Mr. Venkatadri. M. Two Phases of Programming A typical programming task can be divided into two phases: Problem solving.
1 Life Cycle of Software Specification Design –Risk Analysis –Verification Coding Testing –Refining –Production Maintenance.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy Walters, and Godfrey Muganda Modified for use by MSU Dept. of Computer Science.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Data Structures Using C++ 2E
Chapter 8 Testing. Principles of Object-Oriented Testing Å Object-oriented systems are built out of two or more interrelated objects Å Determining the.
ALGORITHMS.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 1. Complexity Bounds.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
Divide and Conquer Strategy
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 2: Getting Started.
Chapter 3: User-Defined Functions I
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R3. Priority Queues.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 15. Dictionaries (1): A Key Table Class.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 8b. Sorting(2): (n log n) Algorithms.
 FUNDAMENTALS OF ALGORITHMS.  FUNDAMENTALS OF DATA STRUCTURES.  TREES.  GRAPHS AND THEIR APPLICATIONS.  STORAGE MANAGEMENT.
Introduction to Computer Programming using Fortran 77.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 3. Time Complexity Calculations.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 3. Introduction to the Analysis of Algorithms.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 8a. Sorting(1): Elementary Algorithms.
CS 116 Object Oriented Programming II Lecture 13 Acknowledgement: Contains materials provided by George Koutsogiannakis and Matt Bauer.
CSCE 210 Data Structures and Algorithms
Introduction to Algorithms: Divide-n-Conquer Algorithms
CSCE 210 Data Structures and Algorithms
Introduction to Algorithms
Algorithms and Problem Solving
Data Structures and Algorithms
About the Presentations
Programming Fundamentals (750113) Ch1. Problem Solving
Software Architecture
Programming Fundamentals (750113) Ch1. Problem Solving
Introduction to Algorithms
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2. Problem Solving and Software Engineering
Presentation transcript:

Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 1. Introduction

Prof. amr Goneid, AUC2 1. Introduction Software for Problem Solving Software Production Process Top-Down Design Modules Structured Software & Program Design Some Guidelines for Design Example C++ Program & Module Structures Object Oriented Programming

Prof. amr Goneid, AUC3 Software for Problem Solving Use of S/W Problem Domain Problem Domain S/W Decide, Learn, View & Interact, Play, ……. Decide, Learn, View & Interact, Play, ……. TO

Prof. amr Goneid, AUC4 Software Production Process Stages of S/W Production Specify Requirements Solution Strategy S/W Production S/W Testing Problem Definition Maintenance Upgrade

Prof. amr Goneid, AUC5 Software Production S/W Design Implementation (Programs) Debugging Performance Analysis / Benchmarks

Prof. amr Goneid, AUC6 Top-Down Design Divide and Conquer Strategy. Given problem X (Level 0). Divide it into sub-problems X1, X2, …, Xn (Level 1) such that solving X1, then X2, then … solves X completely. Repeat for each sub-problem until we reach basic or trivial implementation level.

Prof. amr Goneid, AUC7 Top-Down Design Level X X1X2X3Xn X21X

Prof. amr Goneid, AUC8 Modules In C++ Implemented as Main Problem X Main Program X Implemented as Sub-Problem Xi Module Xi

Prof. amr Goneid, AUC9 Structured Software Design Design Steps Main & Subs Functional Specs Data Specs Algorithm Specs Pseudo- code

Prof. amr Goneid, AUC10 Structured Program Design Main Program and Modules X1 Data Actions (Algorithms) X2 Data Actions (Algorithms) Main Data Main Manager X1 ModuleX2 Module Main Program

Prof. amr Goneid, AUC11 Some Guidelines for Design Transparency of Purpose Correctness Completeness Ease of Use Efficiency Writability Maintainability

Prof. amr Goneid, AUC12 Example of a Design Document Problem Definition: n projects are to be prioritized according to cost (least cost first). Problem size is n Requirement Specification: - Input(s): n, and list of costs in random order. - Output(s): List of costs in ascending order.

Prof. amr Goneid, AUC13 Example(continued) Solution Strategy: 1. Input random List of costs 2. Sort List in ascending order of cost. 3. Print sorted List. S/W Design: Structured (Top-Down) Design: Yields a main module and a sorting module

Prof. amr Goneid, AUC14 Example(continued) S/W Design (continued): Functional Specification: Main Module: –Input list and its size n –Call Sorting module to sort list –Output sorted list Sorting Module: –Receives list and its size n –Returns sorted list

Prof. amr Goneid, AUC15 Example(continued) S/W Design (continued): Data Specification: The cost is an integer number. MAX = 100 to represent maximum list size An Array (a) of size MAX to store list. Algorithm Specification: Sorting module uses the algorithm of Selection Sort.

Prof. amr Goneid, AUC16 Example(continued) S/W Design (continued): Main Module: 1. Input n. 2. Check that n does not exceed MAX. 3. Input random list into array (a). Items will occupy locations a 0 ….. a n-1 4. Call sorting module. 5. Output sorted list (a).

Prof. amr Goneid, AUC17 Example(continued) S/W Design (continued): Sorting module (Selection Sort): Repeat for list items k from 0 to n-2 1. Consider the sub-array from k to n-1 2. Find location of the smallest element in that sub-array 3. Exchange that element with that at (k)

Prof. amr Goneid, AUC18 Example(continued) Implementation Stage: As a C++ Program

Prof. amr Goneid, AUC19 C++ Program Structure Compiler Directives Used Modules (Functions) Prototypes Main Function Header { Main Data Declarations Main Function Actions } Used Modules (Functions) are Defined Here

Prof. amr Goneid, AUC20 C++ Module (Function) Structure Module (Function) Header { Local Data Declarations Module Actions (Executable Statements) }

Prof. amr Goneid, AUC21 Object Oriented Programming Abstraction: Data Model of a physical object or process Methods: Operations (Algorithms) performed on data of an object Class: Entity defining attributes of an object (data and methods) Object: An actual instance of a class