Structure of proecudural programs

Seuqential Code is probably the most straight forward programming construct

  • The computer executes each statement
  • Once the statement has been exectuted it moves onto the next statement
  • Finishes when nothing is left to execute

Selection code is where different code is exectuted dependant on what test is satisfied by the user

Basically

IF condition is TRUE

then do this

ELSE

do that

Iteration is repeating a statement or a compound statement over and over untill a condition is satisfied

3 types of iteration

  • Fixed repitition
  • Pre test
  • Post test

Fixed repitition is where the iteration is set for a certain number of times

Pre test is where the program tests before exectution and the program will only exectute if the loop is true

Post test is where the loop first exectutes and only stops when the boolean expression is tested to be true

?
  • Created by: Seb
  • Created on: 21-05-10 10:14

Comments

No comments have yet been made