1 / 16

Design the program

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

harrywest
Download Presentation

Design the program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 describesequence, 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 100Auxiliary slideMany 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 Answer = Yes Answer = No Askquestion

  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: to Off page: to On page: from

More Related