1 / 7

Pseudo Code

Pseudo Code. Brendan Coulson http://users.csc.calpoly.edu/~jdalbey/SWE/pdl_std.html [Accessed: 19/05/2011]. Pseudo Code - Continued. Pseudo code consists of short, English phrases used to explain specific tasks within a program's algorithm.

billie
Download Presentation

Pseudo Code

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. Pseudo Code Brendan Coulson http://users.csc.calpoly.edu/~jdalbey/SWE/pdl_std.html [Accessed: 19/05/2011]

  2. Pseudo Code - Continued • Pseudo code consists of short, English phrases used to explain specific tasks within a program's algorithm. • Pseudo code is structured English that outlines the logic and structure of program code without being concerned with the exact syntax. • Process descriptor

  3. Pseudo Code - Continued It has been proven that three basic constructs for flow of control are sufficient to implement any "proper" algorithm. SEQUENCE is a linear progression where one task is performed sequentially after another. WHILE is a loop (repetition) with a simple conditional test at its beginning. IF-THEN-ELSE is a decision (selection) in which a choice is made between two alternative courses of action. Key words should be CAPITALISED

  4. Pseudo Code - Examples SEQUENCE Example READ height of rectangle READ width of rectangle COMPUTE area as height times width Common Action Keywords Several keywords are often used to indicate common input, output, and processing operations. Input: READ, OBTAIN, GET Output: PRINT, DISPLAY, SHOW Compute: COMPUTE, CALCULATE, DETERMINE Initialize: SET, INIT Add one: INCREMENT, BUMP

  5. Pseudo Code - Examples SELECTION IF HoursWorked > NormalMax THEN DISPLAY overtime message ELSE DISPLAY regular time message ENDIF

  6. Pseudo Code - Examples WHILE WHILE i < x x = X + i INCREMENT i END WHILE

  7. Pseudo Code • You try some examples • Add Orders • Remove Orders

More Related