The algorithm in Figure 2 has been developed to automate the quantity of dog box biscuits to put in a dog bowl at certain times of the day.
Figure 2
1 time USERINPUT
2 IF time = 'breakfast' THEN
3 q 1
4 ELSE IF time = 'lunch' THEN
5 q 4
6 ELSE IF time = 'dinner' THEN
7 q 2
8 ELSE
9 OUTPUT 'time not recognised'
10 ENDIF
11 FOR n 1 TO q
12 IF n < 3 THEN
13 DISPENSE_BISCUIT('chewies')
14 ELSE
15 DISPENSE_BISCUIT('crunchy')
16 ENDIF
17 ENDFOR
Select one choice which shows the data type of the variable time
in the algorithm shown in Figure 2.
Date/Time
String
Integer
Real
Did this page help you?