Presentation is loading. Please wait.

Presentation is loading. Please wait.

Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.

Similar presentations


Presentation on theme: "Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step."— Presentation transcript:

1 Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step method to solve a problem or complete a task Algorithms must be: –Well defined –Well ordered –Must produce some result –Must terminate in a finite time

2 Documentation program In-program documentation (remarks) Program maintenance manual –For programming experts to help them fix or enhance code written by other programmers Design documentation –Written by programmer to explain rationale behind methods and code used Trade Study documentation –A research tool –An attempt to find the best solution

3 Using Flowchart Symbols and Pseudocode Statements Flowchart: pictorial representation of the logic Pseudocode: English-like representation of the logic –Example:

4 Structured Programming A method for designing and coding programs in a systematic, organized manner It combines the principles of top-down design, modularity and the use of the three accepted control structures of sequence, repetition and selection Sequence, repetition and selection can be expressed in pseudocode, or with flowcharts

5 Flowcharts A tool for programmers to design programs –Describes the flow of a program module’s execution with diagrams –Completely different from hierarchy charts –Connected symbols are used to describe sequence, repetition, and selection structures –Some prefer to use flowcharting to learn how to express algorithms, and others prefer to use pseudocode –Many programs are designed with a combination of pseudocode and flowcharts

6 Flowchart Symbols Wiley text: page 100 Auxiliary slide Many in Powerpoint

7 Flowchart input symbol:

8 Flowchart processing symbol

9 Flowchart output symbol:

10 Flowlines: –Connect the steps –Show the sequence of statements –Have arrows to show the direction Terminal symbol (start/stop symbol): –Shows the start and end points of the statements –Lozenge shape

11 Flowchart vs. Psuedocode

12 Back-pointing arrows show statements that will be repeated (loop)

13 Infinite loop: a sequence of statements that repeats forever with no escape Avoid infinite loops by testing for a predetermined value that means “stop processing” Decision: testing a value Flowchart decision symbol: a diamond shape, with two flowlines, one for Yes and one for No Into decision Ask question Answer = YesAnswer = No

14 Sentinel value (or dummy value) –Does not represent real data –Signal to stop –Can be used with input from files or from users End-of-file (EOF) marker: –Code stored in the file that marks the end of the data –Usually used instead of a sentinel value for file input

15 Flowchart connector symbol: –Marks a logic transfer to another location in the flowchart –Transfer location can be on the same page or on another page –On-page symbol: a circle with a number or letter to identify the matching transfer location –Off-page symbol: a square with a pointed bottom, containing page number and a number of letter to identify the matching transfer location

16 On page: from On page: to Off page: to


Download ppt "Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step."

Similar presentations


Ads by Google