Computer Science (0478) · Oct/Nov 2024 · Mark scheme 22
Cambridge Computer Science (0478) mark scheme for paper 22, Oct/Nov 2024 — 0478/22/O/N/24, file 0478_w24_ms_22.pdf.
Text of this paper
www.dynamicpapers.com
Cambridge IGCSE™
COMPUTER SCIENCE
0478/22
Paper 2 Algorithms, Programming and Logic
October/November 2024
MARK SCHEME
Maximum Mark: 75
Published
This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the
examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the
details of the discussions that took place at an Examiners’ meeting before marking began, which would have
considered the acceptability of alternative answers.
Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for
Teachers.
Cambridge International will not enter into discussions about these mark schemes.
Cambridge International is publishing the mark schemes for the October/November 2024 series for most
Cambridge IGCSE, Cambridge International A and AS Level components, and some Cambridge O Level
components.
This document consists of 14 printed pages.
© Cambridge University Press & Assessment 2024
[Turn over
0478/22
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
2024
Generic Marking Principles
These general marking principles must be applied by all examiners when marking candidate answers.
They should be applied alongside the specific content of the mark scheme or generic level
descriptions for a question. Each question paper and mark scheme will also comply with these
marking principles.
GENERIC MARKING PRINCIPLE 1:
Marks must be awarded in line with:
•
•
•
the specific content of the mark scheme or the generic level descriptors for the question
the specific skills defined in the mark scheme or in the generic level descriptors for the question
the standard of response required by a candidate as exemplified by the standardisation scripts.
GENERIC MARKING PRINCIPLE 2:
Marks awarded are always whole marks (not half marks, or other fractions).
GENERIC MARKING PRINCIPLE 3:
Marks must be awarded positively:
•
•
•
•
•
marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit
is given for valid answers which go beyond the scope of the syllabus and mark scheme,
referring to your Team Leader as appropriate
marks are awarded when candidates clearly demonstrate what they know and can do
marks are not deducted for errors
marks are not deducted for omissions
answers should only be judged on the quality of spelling, punctuation and grammar when these
features are specifically assessed by the question as indicated by the mark scheme. The
meaning, however, should be unambiguous.
GENERIC MARKING PRINCIPLE 4:
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
GENERIC MARKING PRINCIPLE 5:
Marks should be awarded using the full range of marks defined in the mark scheme for the question
(however; the use of the full mark range may be limited according to the quality of the candidate
responses seen).
GENERIC MARKING PRINCIPLE 6:
Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should
not be awarded with grade thresholds or grade descriptors in mind.
© Cambridge University Press & Assessment 2024
Page 2 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
1
Answer
1
Answer
Marks
C
1
Question
3(a)
Marks
C
Question
2
2024
Answer
Marks
One mark for each correct line
4
Flowchart symbol
Purpose
subroutine
process
flow
decision
terminator
© Cambridge University Press & Assessment 2024
Page 3 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
3(b)
Answer
Marks
One mark per mark point
•
•
•
•
•
•
6
Two labelled terminators START and STOP
Loop initialisation, incrementation and termination
Input with prompt
Total initialised and totalling of inputs
Output with message
Fully correct flowchart with all correct arrows, yes/no labels and symbols
START
Total 0
Count 1
OUTPUT "Enter a
value between 1
and 100"
INPUT Number
Total Total + Number
No
o
IS Count
> 50 ?
Count Count + 1
Yes
OUTPUT "The total
is ", Total
STOP
© Cambridge University Press & Assessment 2024
2024
Page 4 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
4(a)
Answer
One mark per mark point
2024
Marks
5
•
Line 02 / DECLARE Counter : STRING
should be DECLARE Counter : INTEGER
•
Line 09 / Temp TRUE
should be Swapped TRUE
•
Line 10 / WHILE Swapped = TRUE OR Pass <= Limit - 1 DO
should be WHILE Swapped = TRUE AND Pass <= Limit - 1 DO
•
Line 17 / ItemList[Counter] Temp
should be ItemList[Counter + 1] Temp
•
Line 19 / ENDCASE
should be ENDIF
Correct algorithm:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
4(b)
DECLARE ItemList : ARRAY[1:100] OF STRING
DECLARE Counter : INTEGER
DECLARE Limit : INTEGER
DECLARE Pass : INTEGER
DECLARE Swapped : BOOLEAN
DECLARE Temp : STRING
Limit 100
Pass 1
Swapped TRUE
WHILE Swapped = TRUE AND Pass <= Limit - 1 DO
Swapped FALSE
FOR Counter 1 TO Limit – Pass
IF ItemList[Counter] > ItemList[Counter + 1]
THEN
Temp ItemList[Counter]
ItemList[Counter] ItemList[Counter + 1]
ItemList[Counter + 1] Temp
Swapped TRUE
ENDIF
Pass Pass + 1
NEXT Counter
ENDWHILE
One mark per mark point (max three)
•
•
•
•
The use of a flag (set initially to FALSE) to show if a swap has been
made (during the current iteration)
… to stop the loop if it has been sorted
The reduction in the limit of the (inner) loop after each iteration (of the loop)
… to reduce the number of comparisons / iterations required
© Cambridge University Press & Assessment 2024
Page 5 of 14
3
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
5(a)
Answer
One mark per mark point (max one)
•
•
•
5(b)
•
•
•
•
•
•
Answer
6
One mark for naming the type of check and one mark for an expansion (max
two)
Visual check
… looking at the data that has been entered and either confirming it is
correct or showing / correcting errors.
OR
•
•
1
3
Abstraction
Discard/remove irrelevant information / hiding complexities /
keeping the key elements of the problem
Decomposition of the problem
Breaking the problem into inputs, processes and outputs
Identification of the problem
Identification of the requirements of the solution to the problem
Research into the problem by data collection
Example of data collection
Question
•
•
Marks
Design
Coding
Testing
One mark per mark point (max three)
•
•
2024
Double entry check // Data entered twice
… data is entered twice and the two sets of data are compared (by
the computer). If they don’t match, an error has been input, so re-entry
is requested.
© Cambridge University Press & Assessment 2024
Page 6 of 14
Marks
2
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
7(a)
Answer
Marks
One mark per mark point (max five)
•
•
•
•
•
2024
5
Correct Value column
Correct Count column
Correct Answer column (down to first OUTPUT (120)) – Shaded grey
Correct Answer column (remaining rows)
Correct OUTPUT column
Value
Count
5
Answer
OUTPUT
5
4
20
3
60
2
120
1
120
6
120
6
5
30
4
120
3
360
2
720
1
720
720
−1
7(b)
One mark for correct answer
Example:
• It multiplies the input number by one less than itself repeatedly, until the
value is 1
• It calculates the number of permutations of all the numbers up to the input
value
1
7(c)
One mark per mark point (max two)
2
•
•
•
The program would accept the value and enter the FOR loop
Count would keep reducing by 1 and would never reach 1, as it would
already be less than 1
There would be an endless loop
© Cambridge University Press & Assessment 2024
Page 7 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
8
Answer
Marks
One mark per mark point (max four)
•
•
•
•
4
80
The largest whole number that would be accepted / at the very limit
/ Boundary/Extreme data that would be accepted / at the very limit
81
The smallest whole number that would be rejected / is greater than
the limit / Boundary/Abnormal/Erroneous data that would be
rejected / is greater than the limit
Question
9(a)
2024
Answer
Marks
One mark for each correct gate, with the correct input(s) as shown.
4
P
Q
X
R
© Cambridge University Press & Assessment 2024
Page 8 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
9(b)
Answer
Four marks for eight correct outputs
Three marks for six or seven correct outputs
Two marks for four or five correct outputs
One mark for two or three correct outputs
P
Q
R
X
0
0
0
1
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
0
1
1
1
1
Question
10
Answer
One mark per mark point (max six)
•
•
•
•
•
•
•
•
•
Declaration of appropriate string variable(s)
Input of a line of text
Correct use of LCASE
Correct use of LENGTH
Opening of at least one of the required text files using given names
(Main.txt, Lowercase.txt)
Storing of correct line of text to Main.txt
Storing of correct lines to Lowercase.txt
Closing of both text files
Correct output
For example:
DECLARE LineOfText : STRING
DECLARE LowercaseText: STRING
INPUT LineOfText
OPENFILE Main.txt FOR WRITE
WRITEFILE Main.txt, LineOfText
CLOSEFILE Main.txt
LowercaseText LCASE(LineOfText)
OUTPUT LowercaseText, LENGTH(LineOfText)
OPENFILE Lowercase.txt FOR WRITE
WRITEFILE Lowercase.txt, LowercaseText
CLOSEFILE Lowercase.txt
© Cambridge University Press & Assessment 2024
Page 9 of 14
2024
Marks
4
Marks
6
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
11(a)
Answer
Marks
One mark per mark point
•
•
2024
2
Fields – 11
Records – 15
11(b)
The Type field contains data that repeats / Data is not unique
1
11(c)
Two marks for four correct fields
One mark for two or three correct fields
2
Field
Data type
RoomNo // Type
alphanumeric
Mon // Tue // Wed // Thu // Fri // Sat // Sun Boolean
11(d)
Rate$
real
Guests
integer
One mark per mark point
•
•
•
3
Data from 4 correct columns printed – any number of rows, any order
Data in rows ordered as shown (row and column) at least two rows
and two columns required
All data correct with no extra content
Correct output
104S
105S
201F
301D
304P
Single
Single
Family
Double
Suite
1
1
4
2
6
72.50
72.50
160.00
200.00
700.00
© Cambridge University Press & Assessment 2024
Page 10 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
Question
12
Answer
•
•
Data Structures required with names as given in the scenario:
Arrays or lists Rooms[], Dimensions[]
Number
Requirements (techniques):
R1 Input and store number of rooms, the names of the rooms and their
dimensions, including validation of number of rooms (input with prompts,
(nested) iteration, use of variables, 1D and 2D arrays, validation).
R2 Calculate and store the area of each room, the total area of the house
and the average room area rounded to two decimal places. Find the
smallest and largest rooms (calculation, totalling, rounding, finding
maximum and minimum values, iteration).
R3 Output the results, including contents of the arrays and the calculated
data (iteration, output).
Example 15-mark answer in pseudocode
// input and validation of number of rooms
REPEAT
OUTPUT "How many rooms are in your house (enter a
number between 3 and 20 inclusive)?"
INPUT Number
IF Number < 3 OR Number > 20
THEN
OUTPUT "The number of rooms must be between 3 and
20 inclusive, please try again"
ENDIF
UNTIL Number >= 3 AND Number <= 20
// input of room names and dimensions – could be more
than one loop
FOR InLoop 1 TO Number
OUTPUT "Enter the name of room ", InLoop
INPUT Rooms[InLoop]
OUTPUT "Enter the length of the room in metres"
INPUT Dimensions[InLoop, 1]
OUTPUT "Enter the width of the room in metres"
INPUT Dimensions[InLoop, 2]
Dimensions[InLoop, 3] ROUND(Dimensions[InLoop, 1]
* Dimensions[InLoop, 2], 2)
NEXT InLoop
// calculates total area and average area – rounded
values have been stored
TotArea 0
FOR Total 1 TO Number
TotArea TotArea + Dimensions[Total, 3]
NEXT Total
AvArea ROUND(TotArea / Number, 2)
© Cambridge University Press & Assessment 2024
Marks
15
AO2 (maximum 9 marks)
AO3 (maximum 6 marks)
Variables
2024
Page 11 of 14
0478/22
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
Question
12
Answer
// finding largest and smallest rooms
Larea 0
Sarea 100000
Lindex 1
Sindex 1
FOR Count 1 TO Number
IF Dimensions[Count, 3] > Larea
THEN
Larea Dimensions[Count, 3]
Lindex Count
ENDIF
IF Dimensions[Count, 3] < Sarea
THEN
Sarea Dimensions[Count, 3]
Sindex Count
ENDIF
NEXT Count
// outputting the results
FOR OutLoop 1 TO Number
OUTPUT "Room: ", Rooms[Outloop]
OUTPUT "Length: ", Dimensions[OutLoop, 1], " metres"
OUTPUT "Width: ", Dimensions[OutLoop, 2], " metres"
OUTPUT "Area: ", Dimensions[OutLoop, 3], " square
metres"
Next OutLoop
OUTPUT "The largest room is: ", Rooms[Lindex]
OUTPUT "The smallest room is: ", Rooms[Sindex]
OUTPUT "The total area of the house is: ", TotArea, "
square metres"
OUTPUT "The average area of the rooms is: ", AvArea, "
square metres"
© Cambridge University Press & Assessment 2024
Page 12 of 14
2024
Marks
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
2024
Marking Instructions in italics
AO2: Apply knowledge and understanding of the principles and concepts of computer
science to a given context, including the analysis and design of computational or
programming problems
0
No creditable
response.
1–3
4–6
7–9
At least one
programming
technique has been
used.
Any use of selection,
iteration, counting,
totalling, input and
output.
Some programming
techniques used are
appropriate to the
problem.
More than one
technique seen applied
to the scenario, check
list of techniques
needed.
The range of
programming
techniques used is
appropriate to the
problem.
All criteria stated for
the scenario have
been covered by the
use of appropriate
programming
techniques, check list
of techniques needed.
Some data has been
stored but not
appropriately.
Any use of variables or
arrays or other
language dependent
data structures e.g.
Python lists.
Some of the data
structures chosen are
appropriate and store
some of the data
required.
More than one data
structure used to store
data required by the
scenario.
The data structures
chosen are appropriate
and store all the data
required.
The data structures
used store all the data
required by the
scenario.
© Cambridge University Press & Assessment 2024
Page 13 of 14
October/November
www.dynamicpapers.com
Cambridge IGCSE – Mark Scheme
PUBLISHED
0478/22
2024
Marking Instructions in italics
AO3: Provide solutions to problems by:
• evaluating computer systems
• making reasoned judgements
• presenting conclusions
0
No creditable
response.
1–2
3–4
5–6
Program seen without
relevant comments.
Program seen with
some relevant
comment(s).
The program has been
fully commented.
Some identifier names
used are appropriate.
Some of the data
structures used have
meaningful names.
The majority of
identifiers used are
appropriately named.
Most of the data
structures used have
meaningful names.
Suitable identifiers with
names meaningful to
their purpose have
been used throughout.
All of the data
structures used have
meaningful names.
The solution is illogical.
The solution contains
parts that may be
illogical.
The program is in a
logical order.
The solution is
inaccurate in many
places.
Solution contains few
lines of code with
errors that attempt to
perform a task given in
the scenario.
The solution contains
parts that are
inaccurate.
Solution contains lines
of code with some
errors that logically
perform tasks given in
the scenario. Ignore
minor syntax errors.
The solution is
accurate.
Solution logically
performs all the tasks
given in the scenario.
Ignore minor syntax
errors.
The solution attempts
at least one of the
requirements.
Solution contains lines
of code that attempt at
least one task given in
the scenario.
The solution attempts
to meet most of the
requirements.
Solution contains lines
of code that attempts
most tasks given in the
scenario.
The solution meets all
the requirements given
in the question.
Solution performs all
the tasks given in the
scenario.
© Cambridge University Press & Assessment 2024
Page 14 of 14