Note AcademyNote Academy

Computer Science · Oct / Nov 2021 · Paper 22 · Question 4

2210

As printed in the paper

The question as text

The pseudocode algorithm should work as a calculator and output the result. 1 Continue 1 2 WHILE Continue = 0 3 OUTPUT "Enter 1 for +, 2 for -, 3 for * or 4 for /" 4 INPUT Operator 5 OUTPUT "Enter the first value" 6 INPUT Value1 7 OUTPUT "Enter the second value" 8 OUTPUT Value2 9 IF Operator 10 1: Answer Value1 + Value2 11 2: Answer Value1 - Value2 12 3: Answer Value1 * Value2 13 4: Answer Value1 / Value2 14 ENDCASE 15 OUTPUT "The answer is ", Value1 16 OUTPUT "Do you wish to enter more values (Yes or No)?" 17 INPUT MoreValues 18 IF MoreValues = "No" 19 THEN 20 Continue 1 21 ENDIF 22 UNTIL Continue = 0

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 4(a)[5]

  • 4(b)[5]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.