Download
pseudo code n.
Skip this Video
Loading SlideShow in 5 Seconds..
Pseudo Code PowerPoint Presentation
Download Presentation
Pseudo Code

Pseudo Code

295 Vues Download Presentation
Télécharger la présentation

Pseudo Code

- - - - - - - - - - - - - - - - - - - - - - - - - - - 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