May/June 2026 Paper 21

2026 · 9 questions · 28 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong28Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
2(a)(i)Data Types Variables Input OutputMedium1 mark
A washing machine contains:
  • two trays for the washing powder
  • a user interface display
  • five sensors.
The washing machine control program includes the following variables:
variabledescription
MainsOnTRUE when the mains power is on
WaterOnTRUE when the water supply to the machine is turned on
DisplayOnTRUE when the user interface display is active
Tray1TRUE when it detects washing powder in tray 1
Tray2TRUE when it detects washing powder in tray 2
Identify the data type used for the five variables.
2(a)(ii)Operators Expressions SelectionMedium1 mark
The display is only active when both the mains power is on and the water supply is turned on. Complete the pseudocode statement.
text
DisplayOn ← …
2(a)(iii)Operators Expressions SelectionMedium3 marks
The washing machine control program will start when a new variable WashStart is assigned the value TRUE. WashStart is assigned the value TRUE when the mains power is switched on and there is washing powder in tray 1 or tray 2 or both trays. Write the pseudocode statement for the given description.

Answer

0 words
2(b)(i)Testing DebuggingMedium1 mark
The user will select from three possible wash options. The pseudocode for the washing machine program contains a procedure WashCycle()
pseudocode
PROCEDURE WashCycle()   // declaration of variables has been omitted   // TimeSoFar is a global variable which changes   // as the procedure is executed   Finished ← FALSE   TimeSoFar ← 0.0   OUTPUT "Option (1/2/3)"   INPUT OptionNumber   CASE OF OptionNumber:      // WashTime is the total wash time in minutes      1 : WashTime ← 60      2 : WashTime ← 90      3 : WashTime ← 120   ENDCASE   WHILE Finished = FALSE      TimeRemaining ← WashTime – INT(TimeSoFar)   ENDWHILEENDPROCEDURE
The programmer uses an Integrated Development Environment (IDE) to develop and run the washing machine program. State the IDE feature to display the current value for any variable during the execution of the program.
2(b)(ii)Data Types Variables Input OutputEasy1 mark
When option 3 is selected, the programmer interrupts execution when the TimeSoFar is 17.6 minutes. State the current value for TimeRemaining

Answer