Past-paper question · 2019 October-November · Paper 22 · Q1(a)(ii)

Question 1(a)(ii) 2019 · October-November · Paper 22 · 5 marks

Original past-paper question for 1(A)(II)
Original past-paper question for 1(A)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 1(A)(II)

Official answer for Question 1

Part (a)

(ii)

Question 5

✓
START
✓
Mark as follows:
✓
Tries ← 1
  • One mark for START and END
  • One mark for each of the 4
✓
areas outlined
✓
Full ←
✓
ReadSensor("F1")
✓
YES
✓
Is Full =
✓
Loop must be included for
✓
TRUE?
✓
this area mark
✓
NO
✓
NO
✓
Is NOT Full
✓
AND Tries < 4
✓
YES
✓
NO
✓
Call TopUp()
✓
Is
✓
Tries > 3?
✓
YES
✓
Full ←
✓
ReadSensor("F1")
✓
Output
✓
"Too many attempts"
✓
Tries ← Tries + 1
✓
Output
✓
"Tank now full"
✓
Output
✓
"Already Full"
✓
END
✓
9608/22
✓
Cambridge International AS/A Level – Mark Scheme
✓
October/November
✓
PUBLISHED
✓
2019
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_w19_ms_22.pdf →

Show text version of question

Question 1

Part (a)

(ii)

Question 1

Study the following pseudocode.

PROCEDURE FillTank()

DECLARE Tries : INTEGER DECLARE Full : BOOLEAN

Tries 1

Full ReadSensor("F1")

IF NOT Full THEN WHILE NOT Full AND Tries < 4 CALL TopUp() Full ReadSensor("F1") Tries Tries + 1 ENDWHILE IF Tries > 3 THEN OUTPUT "Too many attempts" ELSE OUTPUT "Tank now full" ENDIF ELSE OUTPUT "Already full" ENDIF

ENDPROCEDURE

(ii)

Draw a program flowchart to represent the algorithm implemented in the pseudocode.

Variable declarations are not required in program flowcharts.

[5]

Question 4

Topic relevance

Why this question appears here

92% assigned-topic match · Algorithm design and problem-solving › Algorithms

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w19_qp_22.pdf

Keep practising this topic