Computer Science · May / June 2023 · Paper 21 · Question 5
2210
As printed in the paper
The question as text
An algorithm has been written in pseudocode to allow some numbers to be input. All the positive numbers that are input are totalled and this total is output at the end. An input of 0 stops the algorithm. 01 Exit ← 1 02 WHILE Exit <> 0 DO 03 INPUT Number 04 IF Number < 0 05 THEN 06 Total ← Total + Number 07 ELSE 08 IF Number = 0 09 THEN 10 Exit ← 1 11 ENDIF 12 ENDIF 13 ENDIF 14 OUTPUT "The total value of your numbers is ", Number
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
5(a)[4]
5(b)[4]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

