design the program create a detailed description of program –use charts or ordinary language...
TRANSCRIPT
![Page 1: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/1.jpg)
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
![Page 2: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/2.jpg)
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
![Page 3: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/3.jpg)
Using Flowchart Symbols and Pseudocode Statements
• Flowchart: pictorial representation of the logic
• Pseudocode: English-like representation of the logic– Example:
![Page 4: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/4.jpg)
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
![Page 5: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/5.jpg)
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
![Page 6: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/6.jpg)
Flowchart SymbolsWiley text: page 100Auxiliary slideMany in Powerpoint
![Page 7: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/7.jpg)
Flowchart input symbol:
![Page 8: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/8.jpg)
• Flowchart processing symbol
![Page 9: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/9.jpg)
• Flowchart output symbol:
![Page 10: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/10.jpg)
• 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
![Page 11: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/11.jpg)
Flowchart vs. Psuedocode
![Page 12: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/12.jpg)
• Back-pointing arrows show statements that will be repeated (loop)
![Page 13: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/13.jpg)
• 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
Askquestion
Answer = Yes Answer = No
![Page 14: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/14.jpg)
• 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
![Page 15: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/15.jpg)
• 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
![Page 16: Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e885503460f94b8c0c1/html5/thumbnails/16.jpg)
On page: from
On page: to
Off page: to