Past-paper question · 2022 October-November · Paper 22 · Q5(b)

Question 5(b) 2022 · October-November · Paper 22 · 4 marks

Original past-paper question for 5(B)
Original past-paper question for 5(B)
Reveal official mark-scheme answer Official mark-scheme answer for 5(B)

Official answer for Question 5

Part (b)

✓
One mark per mark point, max four

Question 4

✓
MP1
✓
Set up a condition to end the input
✓
MP2
✓
The correct placement of the condition
✓
MP3
✓
Set up the test
✓
MP4
✓
The correct placement of the test
✓
MP5
✓
Removal of MarksEntry counter from the original algorithm
✓
Example answers
✓
Testing at the end of the algorithm
✓
OUTPUT "Do you want to enter another mark?"
✓
INPUT AnotherMark
✓
UNTIL AnotherMark = "No"
✓
should replace line 22 at end of loop
✓
The MarksEntry counter can be removed // Lines 4 and 21 are not required / can be removed
✓
Testing at the beginning of the algorithm
✓
AnotherMark = "Yes"
✓
WHILE AnotherMark = "Yes" DO
✓
should replace line 05 at the start of the loop
✓
OUTPUT "Do you want to enter another mark?"
✓
INPUT AnotherMark
✓
ENDWHILE
✓
should replace line 22 at end of loop
✓
The MarksEntry counter can be removed // Lines 4 and 21 are not required / can be removed
✓
Terminal condition
✓
OUTPUT "Enter -1 to end the program"
✓
should be placed before the loop and / or before the input in 06
✓
IF MARK <> -1 THEN
✓
should be placed between lines 06 and 07
✓
The MarksEntry counter can be removed // Lines 4 and 21 are not required / can be removed
✓
UNTIL Mark = -1 should be placed at line 22
✓
Cambridge IGCSE – Mark Scheme
✓
0478/22
✓
October/November 2022
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 0478_w22_ms_22.pdf →

Show text version of question

Question 5

Part (b)

Question 5

This pseudocode should allow 500 marks to be entered into the algorithm. If the mark is 80 or

greater it is stored in an array for higher marks. If the mark is less than 80, but greater than or equal to 50 it is stored in an array for middle marks. The remaining marks are stored in an array for lower marks. The results from the algorithm are displayed at the end.

01 HighList 0 02 MidList 0 03 LowList 0 04 MarksEntry 0 05 REPEAT 06 INPUT Mark 07 IF Mark >= 80 08 THEN 09 Higher[HighList] MarksEntry 10 HighList HighList + 1 11 ELSE 12 IF Mark >= 50 13 THEN 14 Middle[MidList] Mark 15 MidList MidList 16 ELSE 17 Lower[HighList] Mark 18 LowList LowList + 1 19 ENDIF 20 ENDIF 21 MarksEntry MarksEntry + 1 22 NEXT MarksEntry = 500 23 OUTPUT "You entered ", HighList, " higher marks" 24 OUTPUT "You entered ", MidList, " middle marks" 25 OUTPUT "You entered ", LowList, " lower marks"

Part (b)

The corrected algorithm needs to be changed so that any number of marks may be entered

and the algorithm runs until the user tells it to stop.

Write the new pseudocode statements that would be needed to achieve this and state where in the algorithm they would be placed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[4]

Question 10

Topic relevance

Why this question appears here

98% assigned-topic match · Programming › Arrays

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 0478_w22_qp_22.pdf

Keep practising this topic