Tuesday, July 17, 2012

Selection and Repetition

Selection
Moving through a set of traffic lights.
1. Start car
2. Drive along the streets
3. Check traffic light
4. If red then stop
5. Else continue
6. Repeat step 2

Deciding whether to take an umbrella to school.
1. Check weather
2. If raining take umbrella
3. Else don't take umbrella

Giving a student an A, B or C on their test.
1. Look at mark
2. If mark > 16 give A
3. Else if mark > 12 and < 16 give B
4. Else if mark > 8 and < 12 give C

Repetition
Adding the correct amount of cordial to water to make a drink.
1. Pour the right amount of cordial
2. Pour the right amount of water
3. Keep repeating 1 and 2 until bottle is full
Filling a bucket with water.
1. Open tap
2. Keep water running
3. Close tap when bucket is full
Blowing up a balloon.
1. Blow at the ballon
2. Keep blowing until desired balloon size
3. Tie up the balloon

No comments:

Post a Comment