Beruflich Dokumente
Kultur Dokumente
WRITE AN ALGORITHM
A washing machine is computer controlled. A full cycle consists of:
Check the door is shut Heat water with heater (H) to 80 degrees if hot wash has been selected,
40 degrees if a cool wash has been selected Run wash motor (M) for 20minutes, checking water
every 5minutes to see if heater (H) should be turned on again Sound buzzer to signify that wash
cycle is complete
Note: “M” can be set to “on” or “off”.
Write an algorithm, in whatever form, to show the working of the washing machine?
If hot wash
Then T = 80
Else T = 40
End If
Repeat
H On
Until watertemp = T
H off
For Count = 1 to 4
Count = Count +1
Turn M on
Wait 5 minutes
IF watertemp < T then
Mark points:
M off
*- Condition door is shut with action to shut door/ loop
Repeat to shut door
H On *- Condition hot or cool to set parameter - Turn on
Until water temp = T heater H - Loop until temperature met - Turn M on
End IF *- For loop with correct count... *- and correct step -
Next Check for temperature in loop and correct
action *- Sound buzzer (1 per *-, and any 2 other -,
max 7)
Turn off M
Sound buzzer