Examples:
else.....
This example is a selection because you are making a choice.
2. Do While....EndDo
This example is a repetition.
3. Repeat.....Until.......
This example is a repeition.
Keywords:
- Initialize (set to an initial value)
- Input (get a value)
- Print (output to hard copy)
- You can have Pretest repetition.
- You can also have Post Test repetition.
PSEUDOCODE EXAMPLE:
"Filling a bath with 80L"
Begin
Initialize Volume=0
Turn on tap
Repeat
Wait 1 minute
Until Volume=80
Turn off tap
End.
No comments:
Post a Comment