Past-paper question · 2022 October-November · Paper 22 · Q4(a)

Question 4(a) 2022 · October-November · Paper 22 · 6 marks

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

Official answer for Question 4

Part (a)

✓
One mark per point:

Question 6

Question 1

✓
Input UserID and use of GetAverage()and assignment

Question 2

✓
Initialisation of Total to zero and Index to 4

Question 3

✓
Conditional loop with Index from 4 to 6

Question 4

✓
Assignment of Last from element SameMonth[Index] in a loop

Question 5

✓
Structure: IF...THEN...ELSE...ENDIF in a loop

Question 6

✓
Correct assignments and final call to Update()after the loop
✓
INPUT UserID
✓
Average GetAverage(UserID)
✓
Total 0
✓
Index 4
✓
WHILE Index < 7 // REPEAT
✓
Last SameMonth[Index]
✓
IF Average > Last THEN
✓
Total Total + Average
✓
ELSE
✓
Total Total + Last
✓
ENDIF
✓
Index Index + 1
✓
ENDWHILE // UNTIL Index = 7
✓
CALL Update(UserID, Total)
✓
Alternative solution using FOR loop:
✓
One mark per point FOR loop solution:
✓
1 Input UserID and use of GetAverage()and assignment
✓
2 Initialisation of Total to zero
✓
3 loop Index from 4 to 6

Question 4

✓
Assignment of Last from array SameMonth in a loop

Question 5

✓
Comparison IF...THEN...ELSE...ENDIF in a loop
✓
6 Appropriate assignments in a loop AND final call to Update()after
✓
the loop
✓
INPUT UserID
✓
Average GetAverage(UserID)
✓
Total 0
✓
FOR Index 4 TO 6
✓
Last SameMonth[Index]
✓
IF Average > Last THEN
✓
Total Total + Average
✓
ELSE
✓
Total Total + Last
✓
ENDIF
✓
NEXT Index
✓
CALL Update(UserID, Total)
✓
Cambridge International AS & A Level – Mark Scheme
✓
9618/22
✓
October/November
✓
PUBLISHED
✓
2022
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_w22_ms_22.pdf →

Show text version of question

Question 4

Part (a)

Question 4

The program flowchart represents a simple algorithm.

START

INPUT UserID

Set Average to GetAverage(UserID)

Set Total to 0

Set Index to 4

Add 1 to Index

YES Is Index < 7 ?

NO Set Last to SameMonth[Index]

Is Average NO > Last ? Add Last to Total

YES

Add Average to Total

Update(UserID, Total)

END

Question 9

Part (a)

Write the equivalent pseudocode for the algorithm represented by the flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[6]
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 9618_w22_qp_22.pdf

Keep practising this topic