Monday, September 7, 2009

Selection and repition

Describe in plain english the algorithm for:



1. Moving through a set of traffic lights



a) Approach the set of lights.

b) If red then come to a hault, If green proceed with caution.



2. Deciding to take an umbrella to school



a) have a look outside on how the weather is looking.

b) Have a look at the forecast.

c)If raining or forecast to rain then back umbrella, if not then dont put it in.



3. Giving a student an A,B, or C on a test



a) look at the students progress throughout the whole course.

b) have a look at the way in which they performed in the exam/ quiz

c) award the mark.



Using repetition describe an algorithm for the following;



1. Adding the correct amount of cordial to water to make a drink.



a) get a glass, the cordial and some water.

b) open the cordial and pour some in.

c)add water

d) taste it and decide whether or not to add more cordial.

e) if you want it to be stronger then go onto the repeat step b&c

2. Filling a bucket of water

a) get the bucket
b) turn on the tap
c) fill the bucket to the amount needed
d) if needed repeat steps b&c

3. Blowing up a balloon

a) stretch the mouth piece of the balloon
b) blow the balloon to deired amount
c) if needed repeat step b

No comments:

Post a Comment