Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete.

Similar presentations


Presentation on theme: "Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete."— Presentation transcript:

1 Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete tasks, each of which can be coded in a single procedure!!!

2 Benefits of Functional Decomposition Large problems may be more easily divided into smaller tasks. A program is easier to maintain if each procedure can be tested separately. A top-down design lets you see how procedures are related to each other When the overall design is clear, it is easier to concentrate on the details of each part

3 Example Program Write a program that will display the numbers of a list example: given a list of 4 numbers (each having a value between 0 and 9), display the values, separated by a comma and a space. 1, 2, 3, 4

4 How do you go about doing this Divide and Conquer

5 Structure Chart for Displaying a List of Numbers on the Screen

6 Functional Decomposition of Printing Numbers to screen

7

8

9 Now combine blocks to write program Start with template Add instructions as needed to create working program Add enough comments so that you can reuse the code you write this week later (and also so that at the end of the semester, you can look at the code and quickly determine what the code does!).


Download ppt "Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete."

Similar presentations


Ads by Google