1 / 7

Pseudocode

Pseudocode. Developing Your Program Logic. What is Pseudocode. A computer program is the representation of an "algorithm" (an unambiguous set of steps, in a particular order, which when followed will solve the problem) Pseudocode is the representation of these steps in "structured English"

acondon
Download Presentation

Pseudocode

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. Pseudocode Developing Your Program Logic

  2. What is Pseudocode • A computer program is the representation of an "algorithm" (an unambiguous set of steps, in a particular order, which when followed will solve the problem) • Pseudocode is the representation of these steps in "structured English" • Steps must be clear (i.e. unambiguous) • Order must be specified • When the steps (i.e., instructions) are followed, they must produce a solution to the specified problem

  3. Why Develop Logic Using Pseudocode? • The alternative: just enter Java code? • logic is not clear • computer language (e.g., Java) is too detailed and lengthy • focus moves to language syntax • is not conducive to successive refinement • Flowcharts and other design tools are suitable alternatives to pseudocode

  4. Successive Refinement • Equally applicable whether you use pseudocode or flowcharting • Start at the "top" which is a one line statement of your program's purpose and break it down by stages into greater and greater levels of detail • Successive refinement stops when there is enough detail to write the program • Each pseudocode statement or flowchart symbol is a basic building block (like a tinker toy) • these are assembled into complex structures • assembled in specific ways

  5. Applying Successive Refinement • Start with a one-line statement of the problem • Break down into 3-5 steps • Break down each of these into 3-5 steps • Continue this process (i.e. successive refinement) until each step will become one or a small number of Java statements

  6. Program (Logic) Planning • Look at the output (desired product) • Determine what inputs are necessary to allow the creation of desired output • Design the logic (steps) to collect the input and build the desired output • Often this leads to a general program logic flow of • input • processing • output

  7. Advantages Derived from Using Pseudocode • Good tool for program logic planning • Can use to review system logic with user • Can document logic for system maintenance

More Related