0% found this document useful (0 votes)
15 views512 pages

Computer p2

Uploaded by

Azmat Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views512 pages

Computer p2

Uploaded by

Azmat Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cambridge Assessment International Education

Cambridge International General Certificate of Secondary Education


* 2 5 0 9 2 3 6 3 9 5 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming May/June 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 13 printed pages and 3 blank pages.

DC (SC) 162367/3
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material
The local high school uses buses to transport students to school. There are six bus routes labelled A to F. You have
conducted a survey to analyse the punctuality statistics of these buses over a four-week period. The data from the
survey are shown in the table:

Punctuality table
Day Bus A Bus B Bus C Bus D Bus E Bus F
Mon1 0 0 2 1 −1 0
Tue1 0 1 0 0 −1 −5
Wed1 0 0 −1 0 −1 −5
Thu1 2 0 −1 0 −2 −5
Fri1 2 1 −2 0 −4 −4
Mon2 4 2 −2 0 −10 −3
Tue2 0 0 −3 0 −2 −5
Wed2 3 0 −1 0 0 0
Thu2 4 0 0 0 0 0
Fri2 −2 0 0 0 0 0
Mon3 −5 1 −2 2 0 0
Tue3 0 0 0 0 1 −2
Wed3 0 0 1 0 2 −3
Thu3 3 0 1 0 −3 1
Fri3 4 2 1 0 1 1
Mon4 −1 0 1 0 1 1
Tue4 8 0 −1 0 3 0
Wed4 1 1 −1 0 −1 0
Thu4 1 0 2 0 0 −2
Fri4 −2 0 −2 0 0 −5
Positive numbers represent minutes early, negative numbers represent minutes late and 0 represents the bus having
been on time.

Write and test a program or programs for the local high school.

• Your program or programs must include appropriate prompts for the entry of data; data must be validated on
entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Setting up the data storage.


Using arrays set up a system to enable data for each bus route to be entered covering each day of a four-week
period. It must be possible to enter the data supplied or your own set of data, using suitable prompts as necessary.

Task 2 – Working out the statistics.


Extend your program so that the following statistics for the four-week period may be calculated and output:
• the number of late arrivals for each bus route
• the average number of minutes late for each bus route
• the bus route with the highest number of days on which it was late
• the average number of minutes late for each bus route, using only data from days on which it was late
All the results should be displayed with appropriate annotation.

Task 3 – Checking specific days.


Extend the program as follows:
• Allow the user to input a specific day, for example Fri3, to be used for analysis of data.
• Find and display how many buses were late on this particular day.
• For each late bus, display the route label and how late the bus was on this particular day.

© UCLES 2019 0478/21/M/J/19


3

1 (a) All variables, constants and other identifiers must have meaningful names.

(i) State one array you used for Task 1. State the data type and purpose of this array.

Array ..................................................................................................................................

Data type ...........................................................................................................................

Purpose .............................................................................................................................

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

...........................................................................................................................................
[3]

(ii) State one variable you used for Task 2 and one variable you used for Task 3. In each
case, state the data type and purpose of the variable.

Task 2 variable name ........................................................................................................

Data type ...........................................................................................................................

Purpose .............................................................................................................................

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

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

Task 3 variable name ........................................................................................................

Data type ...........................................................................................................................

Purpose .............................................................................................................................

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

...........................................................................................................................................
[6]

© UCLES 2019 0478/21/M/J/19 [Turn over


4

(b) Write an algorithm to show how you calculated and output the number of late arrivals and the
average number of minutes late for each bus route (part of Task 2), using either pseudocode,
programming statements or a flowchart.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2019 0478/21/M/J/19


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [6]
© UCLES 2019 0478/21/M/J/19 [Turn over
6

(c) Explain how your program uses the input in Task 3 to only find the data for that specific day
(part of Task 3). Any programming statements used in your answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [3]

© UCLES 2019 0478/21/M/J/19


7

(d) Explain how you would alter your program in Task 1 to allow you to choose the number of
weeks to enter data on bus arrival times.

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [2]

© UCLES 2019 0478/21/M/J/19 [Turn over


8

Section B

2 Describe each of the following data types used in programming. In each case, give an example of
a piece of data to illustrate your answer. Each example must be different.

Char

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

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

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

String

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

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

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

Boolean

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

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

...................................................................................................................................................
[6]

3 (a) Give an example of a conditional statement using pseudocode.

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

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

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

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

............................................................................................................................................. [2]

(b) Describe the purpose of a conditional statement.

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

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

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

............................................................................................................................................. [2]

© UCLES 2019 0478/21/M/J/19


9

Question 4 starts on page 10.

© UCLES 2019 0478/21/M/J/19 [Turn over


10

4 This section of program code may be used as a validation check.

1 PRINT "Input a value between 0 and 100 inclusive"


2 INPUT Value
3 WHILE Value < 0 OR Value > 100
4 PRINT "Invalid value, try again"
5 INPUT Value
6 ENDWHILE
7 PRINT "Accepted: ", Value

(a) Give a name for this type of validation check.

............................................................................................................................................. [1]

(b) Describe what is happening in this validation check.

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

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

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

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

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

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

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

............................................................................................................................................. [2]

(c) Complete the trace table for this program code using the test data: 200, 300, –1, 50, 60

Value OUTPUT

[3]

© UCLES 2019 0478/21/M/J/19


11

(d) Draw a flowchart to represent this section of program code.

[5]
© UCLES 2019 0478/21/M/J/19 [Turn over
12

5 The table, BEVERAGES, shows the number of calories in 100 ml of a range of popular beverages.
It also shows the availability of these drinks in a can, a small bottle and a large bottle.

BevNo BevName Calories Can Small Bottle Large Bottle


Bev01 Cola 40 Yes Yes Yes
Bev02 Lime 45 Yes No Yes
Bev03 Energy Drink 1 52 Yes Yes No
Bev04 Energy Drink 2 43 Yes No No
Bev05 Mango 47 Yes No Yes
Bev06 Lemon Iced Tea 38 Yes No Yes
Bev07 Lemonade 58 Yes Yes Yes
Bev08 Orange Juice 46 Yes Yes No
Bev12 Apple Juice 50 Yes Yes No
Bev15 Chocolate Milk 83 Yes Yes No

(a) Give a reason for choosing BevNo as the primary key for this table.

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

............................................................................................................................................. [1]

(b) State the number of records shown in the table BEVERAGES.

............................................................................................................................................. [1]

© UCLES 2019 0478/21/M/J/19


13

(c) List the output that would be given by this query-by-example.

Field: BevNo BevName Can Small Bottle Large Bottle

Table: BEVERAGES BEVERAGES BEVERAGES BEVERAGES BEVERAGES

Sort: Descending

Show: ü ü
Criteria: = "Yes" = "Yes" = "Yes"

or:

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

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

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

............................................................................................................................................. [3]

(d) Complete the query-by-example grid to output a list showing just the names and primary keys
of all the beverages with a calorie count greater than 45. The list should be in alphabetical
order of names.

Field:

Table:

Sort:

Show:
Criteria:

or:

[4]

© UCLES 2019 0478/21/M/J/19


14

BLANK PAGE

© UCLES 2019 0478/21/M/J/19


15

BLANK PAGE

© UCLES 2019 0478/21/M/J/19


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/21/M/J/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/21


Paper 1 May/June 2019
MARK SCHEME
Maximum Mark: 50

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 May/June 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and
some Cambridge O Level components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 9 printed pages.

© UCLES 2019 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

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 descriptors
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.

© UCLES 2019 Page 2 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(a)(i) Many correct answers, the name must be meaningful. Must relate to Task 1 3
1 mark per bullet point

e.g.1
• Array BusA
• Data type integer
• Purpose storing the minutes late

e.g.2
• Array Day
• Data type string
• Purpose storing the code for the day of the week

1(a)(ii) Many correct answers, the name must be meaningful. Names shown are 6
examples only.
1 mark per bullet point

• Task 2 variable name BusAMinsLate


• Data type real
• Purpose used in calculation of average minutes late

• Task 3 variable name SearchDay


• Data type string
• Purpose to input the day to be searched for

1(b) 1 mark for each point: 6


MP1 Conditional statement to identify when a bus is late (punctuality
< 0)
MP2 Count the number of late days for at least one bus route
MP3 Total the late minutes for at least one bus route
MP4 Calculation of average minutes late

1 mark for each point (max three points):


MP5 Initialisation of counting/totalling variables
MP6 Iteration through days
MP7 Checking all buses«
MP8 Count late days and total minutes for all bus routes
MP9 Output of number of late arrivals or average minutes late for at
least one bus route«
MP10 Output complete with all bus routes with late arrivals and
average minutes late, with appropriate messages

Example algorithm on next page

© UCLES 2019 Page 3 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(b) Example algorithm


CountA ← 0; CountB ← 0; CountC ← 0; CountD ← 0;
CountE ← 0; CountF ← 0
TotalA ← 0; TotalB ← 0; TotalC ← 0; TotalD ← 0;
TotalE ← 0; TotalF ← 0
FOR Days ← 0 to 19
IF BusA[Days] < 0
THEN
CountA ← CountA + 1
TotalA ← TotalA + BusA[Days]
ENDIF
IF BusB[Days] < 0
THEN
CountB ← CountB + 1
TotalB ← TotalB + BusBA[Days]
ENDIF
IF BusC[Days] < 0
THEN
CountC ← CountC + 1
TotalC ← TotalC + BusC[Days]
ENDIF
IF BusD[Days] < 0
THEN
CountD ← CountD + 1
TotalD ← TotalD + BusD[Days]
ENDIF
IF BusE[Days] < 0
THEN
CountE ← CountE + 1
TotalE ← TotalE + BusE[Days]
ENDIF
IF BusF[Days] < 0
THEN
CountF ← CountF + 1
TotalF ← TotalF + BusF[Days]
ENDIF
NEXT
PRINT "The number of late days for each bus route are:
Bus A "CountA", Bus B "CountB", Bus C "CountC", Bus D ",
CountD", Bus E ", CountE", Bus F "CountF
PRINT "The average number of minutes late for each route
are: Bus A "TotalA/20", Bus B "TotalB/20", Bus C
"TotalC/20", Bus D ", TotalD/20", Bus E ", TotalE/20",
Bus F "TotalF/20

© UCLES 2019 Page 4 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(c) Explanation of how the candidate’s program performed the following: 3

Three from:
MP1 The input stored as a variable
MP2 The method used to find the position of the day in the Day
array that matches the input
MP3 The array index is stored as a variable
MP4 The index variable used as the array index for each bus array
MP5 «and the contents of each array stored/output.

1(d) Two from: 2


MP1 Add a user input and prompt to enter the number of weeks
required to record data on arrival times
MP2 Store the user input for number of weeks as a variable
MP3 Calculation to change number of weeks to number of days
MP4 Replace the upper limit of the loop with a variable
MP5 Increase the maximum size of the arrays to accommodate a
higher number of weeks

Question Answer Marks

2 Many possible answers, those given are examples only. 6


1 mark for each correct description and 1 mark for each correct example

Char
Description: A single character (from the keyboard)
Example: A/#/2

String
Description: An (ordered) sequence of characters
Example: Hello world / #123?Y / 234 78963

Boolean
Description: A data type with two possible values
Example: TRUE / FALSE

© UCLES 2019 Page 5 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

3(a) Many possible answers, those given are examples only. 2


1 mark per bullet:
• IF
• Condition and outcome

Example answer:
IF X < 0
THEN
PRINT "Negative"
ELSE
PRINT "Not negative"
ENDIF

OR

1 mark per bullet:


• CASE
• Condition and outcome

Example answer:
CASE X OF
1: PRINT ("ONE")
2: PRINT ("TWO")
OTHERWISE PRINT ("Less than ONE or more than TWO")
ENDCASE

3(b) • To allow different routes through a program 2


• dependent on meeting certain criteria

Question Answer Marks

4(a) Range check 1

4(b) Two from: 2

• The entered number (Value)is being checked to see that it is not


< 0 or not > 100
• If it is, it is rejected and the user has to enter another number / an
error message is displayed
• Otherwise the number is accepted, the word ‘Accepted’ is output
along with the Value

© UCLES 2019 Page 6 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

4(c) 3
Value OUTPUT

Input a value between 0 and 100


inclusive

200 Invalid value, try again

300 Invalid value, try again

–1 Invalid value, try again

50 Accepted: 50

1 mark – Value column


1 mark – OUTPUT column first line
1 mark – OUTPUT column lines two to five

© UCLES 2019 Page 7 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

4(d) 5
START

PRINT "Input a
value between
0 and 100
inclusive"

INPUT Value
PRINT "Invalid
value, try
again"

IS Value < 0
Yes
OR
IS Value > 100 ?

No

PRINT
"Accepted: ",
Value

END

1 mark – Input prompt and input value


1 mark – Correct decision box labelled sufficiently (Yes/No) – allow 2
decision boxes
1 mark – Remaining outputs correct
1 mark – All connecting lines and arrows to be complete and correct
1 mark – Standard flowchart symbols used

© UCLES 2019 Page 8 of 9


0478/21 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

5(a) Each data value is unique 1

5(b) 10 records 1

5(c) Bev07 Lemonade 3


Bev01 Cola

1 mark for each correct content


1 mark for each correct format
1 mark for correct order

5(d) 4
Field: BevNo BevName Calories

Table: BEVERAGES BEVERAGES BEVERAGES

Sort: Ascending

Show: ; ; † † † †
Criteria: >45

or:

1 mark for correct Field row


1 mark for Table and Sort rows
1 mark for correct Show row
1 mark for correct Criteria rows

© UCLES 2019 Page 9 of 9


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
* 2 5 2 6 7 5 1 7 2 1 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming May/June 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 13 printed pages and 3 blank pages.

DC (LT/JG) 162368/2
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material

An auction company has an interactive auction board at their sale rooms, which allows buyers to
place bids at any time during the auction. Before the auction starts, the sellers place their items
in the sale room with a unique number attached to each item (item number). The following details
about each item need to be set up on the interactive auction board system: item number, number of
bids, description and reserve price. The number of bids is initially set to zero.

During the auction, buyers can look at the items in the sale room and then place a bid on the
interactive auction board at the sale room. Each buyer is given a unique number for identification
(buyer number). All the buyer needs to do is enter their buyer number, the item number and their bid.
Their bid must be greater than any existing bids.

At the end of the auction, the company checks all the items and marks those that have bids greater
than the reserve as sold. Any items sold will incur a fee of 10% of the final bid to be paid to the
auction company.

Write and test a program or programs for the auction company.

• Your program or programs must include appropriate prompts for the entry of data, data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Auction set up.

For every item in the auction the item number, description and the reserve price should be recorded.
The number of bids is set to zero. There must be at least 10 items in the auction.

Task 2 – Buyer bids.

A buyer should be able to find an item and view the item number, description and the current highest
bid. A buyer can then enter their buyer number and bid, which must be higher than any previously
recorded bids. Every time a new bid is recorded the number of bids for that item is increased by one.
Buyers can bid for an item many times and they can bid for many items.

Task 3 – At the end of the auction.

Using the results from TASK 2, identify items that have reached their reserve price, mark them as
sold, calculate 10% of the final bid as the auction company fee and add this to the total fee for all
sold items. Display this total fee. Display the item number and final bid for all the items with bids that
have not reached their reserve price. Display the item number of any items that have received no
bids. Display the number of items sold, the number of items that did not meet the reserve price and
the number of items with no bids.

© UCLES 2019 0478/22/M/J/19


3

1 (a) All variables, constants and other identifiers must have meaningful names.

Describe the data structures you have used in Task 1 to record the items for sale. Include
some sample data for each data structure you have described.

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]

(b) Explain how your program for Task 1 ensures the item number is unique.

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

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

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

............................................................................................................................................. [2]

© UCLES 2019 0478/22/M/J/19 [Turn over


4

(c) Write an algorithm for the part of Task 2 that allows the buyer to add a new bid, using
either pseudocode, programming statements or a flowchart. Assume that Task 1 has been
completed and that the item details have already been found.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2019 0478/22/M/J/19


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]

© UCLES 2019 0478/22/M/J/19 [Turn over


6

(d) Explain how your program for Task 2 checks that a new bid is higher than previous bids for
an item.

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

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

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

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

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

............................................................................................................................................. [3]

© UCLES 2019 0478/22/M/J/19


7

(e) Explain how your program identifies the items that have reached their reserve price, then
calculates and displays the total auction company fee for all sold items as part of Task 3. Any
programming statements used in your answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]

© UCLES 2019 0478/22/M/J/19 [Turn over


8

Section B

2 (a) An algorithm has been written in pseudocode to input 100 numbers, select and print the
largest number and smallest number.

Count 1
INPUT Number
High Number
Low Count
REPEAT
INPUT Number
IF Number > High
THEN
High Number
ENDIF
IF Number > Low
THEN
Low Number
ENDIF
Count Count + 1
UNTIL Count > 99
PRINT "Largest Number is ", Number
PRINT "Smallest Number is ", Low

Find the four errors in the pseudocode and suggest a correction for each error.

Error 1 ........................................................................................................................................

Correction .................................................................................................................................

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

Error 2 ........................................................................................................................................

Correction .................................................................................................................................

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

Error 3 ........................................................................................................................................

Correction .................................................................................................................................

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

Error 4 ........................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2019 0478/22/M/J/19


9

(b) Show how you would change the corrected algorithm to total the numbers and print the total.
Use a variable Total.

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

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

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

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

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

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

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

............................................................................................................................................. [4]

© UCLES 2019 0478/22/M/J/19 [Turn over


10

3 This flowchart inputs the marks gained in an examination. An input of –1 ends the routine.

START

Total 0
Count 0
Distinction 0

INPUT Mark

Is Mark = –1 ? Yes
Total Total + Mark
Count Count + 1

No

No Is OUTPUT "Number of
Mark >= Distinctions ", Distinction
80 ? OUTPUT "Average Mark "
Total/Count
Yes

Distinction Distinction + 1 END

Complete the trace table for the mark input data: 50, 70, 65, 30, 95, 50, 55, 85, 65, 35, –1, 45

Total Count Distinction Mark OUTPUT

[4]
© UCLES 2019 0478/22/M/J/19
11

4 For each of the four groups of statements in the table, place a tick in the correct column to show
whether it is an example of Selection or Repetition.

Statements Selection Repetition


FOR A 1 TO 100
B B + 1
NEXT A
CASE A OF
100: B A
200: C A
ENDCASE
IF A > 100
THEN
B A
ENDIF
REPEAT
A B * 10
UNTIL A > 100
[4]

5 Explain what is meant by validation and verification.


Give an example for each one.

Validation ..........................................................................................................................................

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

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

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

Example ...........................................................................................................................................

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

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

Verification ........................................................................................................................................

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

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

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

Example ...........................................................................................................................................

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

..........................................................................................................................................................
[6]

© UCLES 2019 0478/22/M/J/19 [Turn over


12

6 A database table, FLIGHT, is used to keep a record of flights from a small airfield. Planes can
carry passengers, freight or both. Some flights are marked as private and only carry passengers.

Flight number Plane Notes Departure time Passengers


FN101 Caravan 1 Private passenger flight 08:00 Y
CN101 Caravan 2 Freight only 08:30 N
CN102 Piper 1 Freight only 09:00 N
FN104 Piper 2 Passengers only 09:20 Y
FN105 Piper 1 Freight and passengers 10:00 Y
FN106 Caravan 1 Passengers only 10:30 Y
CN108 Caravan 2 Freight only 08:00 N
CN110 Lear Private passenger flight 08:00 Y

(a) State the field that could have a Boolean data type.

Field .................................................................................................................................... [1]

© UCLES 2019 0478/22/M/J/19


13

(b) A query-by-example has been written to display just the flight numbers of all planes leaving
after 10:00 that only carry passengers.

Field: Flight number Passengers Departure time


Table: FLIGHT FLIGHT FLIGHT
Sort:

Show: 3

Criteria: =Y = 10:00
or:

Explain why the query-by-example is incorrect, and write a correct query-by-example.

Explanation ...............................................................................................................................

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

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

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

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

Field:
Table:
Sort:

Show:

Criteria:
or:
[7]

© UCLES 2019 0478/22/M/J/19


14

BLANK PAGE

© UCLES 2019 0478/22/M/J/19


15

BLANK PAGE

© UCLES 2019 0478/22/M/J/19


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/22/M/J/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/22


Paper 2 May/June 2019
MARK SCHEME
Maximum Mark: 50

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 May/June 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and
some Cambridge O Level components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 9 printed pages.

© UCLES 2019 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

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 descriptors
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.

© UCLES 2019 Page 2 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

Section A

1(a) 4 marks for: 5


Data Structure(s) max 2
• Arrays
• Variable(s) for // data entry such as reserve price // index / constant
for minimum number of items
Further description max 3
• Data type(s) one or more
• Use(s) one or more
• Name(s) one or more e.g. Item_Number, NumberBids,
Description, Reserve Price
• Sample data for appropriate arrays e.g. 1234, 0, vase, 20.00 //
Sample data for variable or constant e.g. 10
1 mark for:
• At least four appropriate named arrays with sample data

1(b) • Keep a counter/number 2


• Add one every time a new item is added
or
• Keep a list of numbers used
• Using a loop check number is not already in the list before a new
item number is added

© UCLES 2019 Page 3 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(c) Five from: 5


MP1 Enter Buyer Number
MP2 Check if buyer number valid
MP3 Enter new bid
MP4 Check if new bid less than or equal to current highest bid
MP5 if so reject
MP6 Otherwise store the bid entered as new highest bid
MP7 Increase number of bids by one
MP8 Store Buyer Number

Sample answer

REPEAT
PRINT "Enter Buyer Number"
INPUT BuyerNumber
UNTIL BuyerNumber >= BuyerLow and BuyerNumber <=
BuyerHigh
REPEAT
PRINT "Enter Bid -99 to exit"
INPUT Bid
IF Bid > HighestBid(item)
THEN
HighestBid(item) ← Bid
NumberBids(item) ← NumberBids(item) + 1
ENDIF
UNTIL Bid > HighestBid(item) OR Bid = -99
IF Bid <> -99
THEN
BuyerItem(item) ← BuyerNumber
ENDIF

There are many possible correct answers, this is an example only.

1(d) Three from: 3


MP1 Using index number of item, to find if any bids for item exist
MP2 Using IF/UNTIL/WHILE (statement) to compare new bid with
highest/latest bid recorded
MP3 Use an assignment (statement) to replace current highest bid, if
new bid greater than current highest bid
MP4 else reject bid // using a (REPEAT/WHILE) loop ask for bid to be
re-entered
MP5 If number of bids / highest bid = zero add bid (provided greater than
zero)

© UCLES 2019 Page 4 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(e) Explanation of how the candidate’s program performed the following. 5

Five from:
MP1 Method to search item arrays
MP2 Conditional statement used to check for the successful bids
MP3 equal to / greater than reserve price
MP4 Method used to calculate 10% percent of successful bid (for each
item)
MP5 and add to auction company total fee
MP6 Method used to display total fee with a suitable message

All programming statements used must be explained.

© UCLES 2019 Page 5 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

Section B

2(a) 1 mark for each error identified + suggested correction 4


• Low ← Count should be Low ← Number
• Number > Low should be Number < Low
• UNTIL Count = 99 should be UNTIL Count > 99 or UNTIL
Count = 100 or UNTIL Count >= 100 // Count ← 1
should be Count ← 0
• PRINT "Largest Number is ", Number should be PRINT
"Largest Number is ", High

2(b) MP1 Add Total ← 0 // Total ← Number 4


MP2 Add Total ← Total + Number
MP3 Add PRINT "Total is ", Total
MP4 All positioning explained / seen

Count ← 1
INPUT Number
High ← Number
Low ← Number
Total ← Number
REPEAT
INPUT Number
Total ← Total + Number
IF Number > High
THEN
High ← Number
ENDIF
IF Number < Low
THEN
Low ← Number
ENDIF
Count ← Count + 1
UNTIL Count > 99
PRINT "Largest Number is ", High
PRINT "Smallest Number is ", Low
PRINT "Total is ", Total

© UCLES 2019 Page 6 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

3 4
Total Count Distinction Mark OUTPUT

0 0 0 50

50 1 0 70

120 2 0 65

185 3 0 30

215 4 0 95

310 5 1 50

360 6 1 55

415 7 1 85

500 8 2 65

565 9 2 35

600 10 –1 Number of
Distinctions 2

Average Mark 60
1 mark for Total and Count columns both correct.
1 mark for each correct column apart from Total and Count.
If no marks awarded allow 1 mark for initialisation of Total, Count and
Distinction, set to zero.

© UCLES 2019 Page 7 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

4 4
Statements Selection Repetition

FOR A ← 1 TO 100
B ← B + 1 9
NEXT A

CASE A OF
100: B ← A
9
200: C ← A
ENDCASE

IF A > 100
THEN
9
B ← A
ENDIF

REPEAT
A ← B * 10 9
UNTIL A > 100

1 mark for each correct row

Question Answer Marks

5 Validation 6
Two from:
• automated checking
• checking that data is reasonable / of a certain type
• checking that data meets certain criteria

Example 1 mark
• range check // length check // type check // check digit etc.

Verification
Two from:
• checking that data has not changed
• during input to a computer
• during transfer between computers / devices

Example 1 mark
• double entry // checking against original // visual check // use of
checksum etc.

© UCLES 2019 Page 8 of 9


0478/22 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

6(a) Passengers 1

6(b) Explanation 7
Three from:
• Flight number not displayed
• Passengers displayed when should not be
• Departure time = not >
• "Freight and passengers" flight not excluded

Revised QBE – answers shown are examples only


1 mark per bullet
• correct field and table names (either 3 or 4 columns) must include
Notes, Flight number and Departure time
• correct show
• correct time criteria for the candidate’s QBE grid
• use of criteria to select planes with passengers only

Field: Flight number Passengers Departure time Notes

Table: FLIGHT FLIGHT FLIGHT FLIGHT

Sort:

Show: ; † † †
=Y >10:00 <> "Freight and
Criteria:
passengers"

or:
OR
Field: Flight number Departure time Notes

Table: FLIGHT FLIGHT FLIGHT

Sort:

Show: ; † †
Criteria: >10:00 = "Passengers only"

>10:00 ="Private passenger


or:
flight"

© UCLES 2019 Page 9 of 9


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
* 6 8 8 5 1 6 3 7 0 1 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming May/June 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 15 printed pages and 1 blank page.

DC (ST/ST) 162394/4
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release Material

A discount stationery store sells items in bulk at a discount to its customers. Customers can order from
a small range of items available on that day. The greater the quantity of an item they buy in one order,
the greater the discount for that item.

Quantity of an item Discount


10 5%
20 10%
50 25%
100 35%
500 50%

In addition to this, new customers can use a $10 voucher, provided their order comes to more than
$50. Also, returning customers are given a discount voucher with a monetary value.

Write and test a program or programs for the discount stationery store.

• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Stationery available on the day.

Using arrays, set up a list of at least 10 different items available that day. For every item include: item
code, description, price and the amount in stock. All item codes must be different. Display the item
code, description, price and the amount in stock on the screen.

Task 2 – Customer places an order.

The customer chooses an item code from the list of currently available items. Any items that are out of
stock are not displayed and any items that have low stock of 10 or fewer are highlighted. The customer
enters the number they wish to purchase. If there are not enough items in stock the number is rejected.
The price to pay and any discount is shown on the screen. When the order is complete, any customer
discount voucher is applied and the total price is shown. If the customer confirms the order, the stock
numbers are then updated.

Task 3 – At the end of the day.

List the item codes of any items that have sold out. Display the item code of any items of which none
have been sold. Display the item code and description of the item of which the greatest quantity have
been sold today.
© UCLES 2019 0478/23/M/J/19
3

1 (a) All variables, constants and other identifiers must have meaningful names.

Describe the data structures you have used in Task 1 to record the items available that day.
Include some sample data for each data structure you have described.

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]

(b) Explain how your program for Task 1 ensures all the item codes are different.

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

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

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

............................................................................................................................................. [2]

(c) Explain how your program for Task 2 highlights items where the stock level is low.

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

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

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

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

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

............................................................................................................................................. [3]

© UCLES 2019 0478/23/M/J/19 [Turn over


4

(d) Write an algorithm for Task 2 using either pseudocode, programming statements or a
flowchart. Assume that Task 1 has been completed and the list of items currently available
has already been displayed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2019 0478/23/M/J/19


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]
© UCLES 2019 0478/23/M/J/19 [Turn over
6

(e) Explain how your program completes Task 3. Any programming statements used in your
answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]
© UCLES 2019 0478/23/M/J/19
7

Question 2 begins on page 8.

© UCLES 2019 0478/23/M/J/19 [Turn over


8

Section B

2 (a) An algorithm has been written in pseudocode to input the weight of 500 items and reject any
that are over-weight or under-weight, then print the percentage rejected.
Count 1
Reject 0
Over 62
Under 58
REPEAT
INPUT ItemWeight
IF ItemWeight > Over AND ItemWeight < Under
THEN
Reject Reject - 1
ENDIF
Count Count + 1
UNTIL Count > = 500
Reject Reject / 100
PRINT "Percentage rejected is ", Reject

Find the four errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

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

Correction .................................................................................................................................

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

Error 2 .......................................................................................................................................

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

Correction .................................................................................................................................

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

Error 3 .......................................................................................................................................

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

Correction .................................................................................................................................

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

Error 4 .......................................................................................................................................

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

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2019 0478/23/M/J/19


9

(b) Describe how you would change the corrected algorithm to calculate the number accepted
instead of rejected, using a variable Accept, and print a warning if fewer than 50% are
accepted.

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

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

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

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

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

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

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

............................................................................................................................................. [4]

© UCLES 2019 0478/23/M/J/19 [Turn over


10

3 This flowchart inputs the tread depth of five tyres, four on the car and a spare tyre. Any tread
depth of 1.6 mm or less is rejected. To be potentially roadworthy, a car must have four tyres with a
tread depth greater than 1.6 mm.

START

TreadReject 0
Count 1

Is Yes
Count = 6?

Count Count + 1 No
Is No
INPUT Depth TreadReject
<= 1?

Yes OUTPUT "Car is


not roadworthy"

No Is
Depth <=
1.6?

Yes

TreadReject TreadReject + 1

OUTPUT "Car is
potentially
roadworthy"

END

© UCLES 2019 0478/23/M/J/19


11

Complete Trace table 1 for the tread depth input data:


1.7, 1.9, 1.4, 1.8, 2.0

TreadReject Count Depth OUTPUT

Trace table 1

Complete Trace table 2 for the tread depth input data:


1.2, 1.9, 1.4, 1.8, 2.4

TreadReject Count Depth OUTPUT

Trace table 2
[4]

© UCLES 2019 0478/23/M/J/19 [Turn over


12

4 For each of the four checks in the table, place a tick in the correct column to show whether it is an
example of a validation or verification check.

Statements Validation Verification


Range check
Double entry
Check digit
Presence check
[4]

5 Identify and describe three loop structures that are available in pseudocode.

Loop structure 1 ...............................................................................................................................

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

Description .......................................................................................................................................

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

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

Loop structure 2 ...............................................................................................................................

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

Description .......................................................................................................................................

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

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

Loop structure 3 ...............................................................................................................................

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

Description .......................................................................................................................................

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

..........................................................................................................................................................
[6]

© UCLES 2019 0478/23/M/J/19


13

Question 6 begins on page 14.

© UCLES 2019 0478/23/M/J/19 [Turn over


14

6 A database table, TRAIN, is used to keep a record of train departures from a station.

Train Number Platform Destination Departure Time Status


1A37 1 Newtown 08:00 On time
2X19 2 Anytown 08:10 Late
1A29 1 Bigcity 08:15 On time
1A28 2 Anytown 08:30 Cancelled
1A67 3 Gardenvillage 08:45 On time
1A37 1 Newtown 08:50 On time
1A24 2 Charter Train 09:00 Late
1A67 3 Gardenvillage 09:15 On time

(a) Explain why the field Train Number could not be used as a primary key.

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

............................................................................................................................................. [1]

© UCLES 2019 0478/23/M/J/19


15

(b) A query-by-example has been written to display only the train numbers and platforms of all
trains leaving after 08:30 that are late.

Field: Train Number Platform Departure Time Status


Table: TRAIN TRAIN TRAIN TRAIN
Sort:
Show: 3
Criteria: =Y < 08:30
or: = "Late"

Explain why the query-by-example is incorrect, and write a correct query-by-example.

Explanation ...............................................................................................................................

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

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

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

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

Field:
Table:
Sort:
Show:
Criteria:
or:
[7]

© UCLES 2019 0478/23/M/J/19


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/23/M/J/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/23


Paper 2 May/June 2019
MARK SCHEME
Maximum Mark: 50

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 May/June 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and
some Cambridge O Level components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 8 printed pages.

© UCLES 2019 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

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 descriptors
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.

© UCLES 2019 Page 2 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

Section A

1(a) 4 marks for: 5


Data Structure(s) max 2
• Arrays
• Variable(s) for // data entry such as Item Code // index / constant
for minimum number of items
Further description max 3
• Data type(s) one or more
• Use(s) one or more
• Name(s) one or more e.g. Item_Code, Description, Price,
Stock
• Sample data for appropriate arrays e.g. 1234, Notepad, 0.050,
1000 // Sample data for variable or constant e.g. 10

1 mark for:
• All four names and suitable data samples

1(b) • Keep a counter/number 2


• Add one every time a new item code is added
or
• Keep a list of item codes used
• Using a loop check item codes is not already in the list before a
new item code is added

1(c) • Check items in stock array 3


• with a value of 10 or less
• Display these values in a different way e.g. in red

© UCLES 2019 Page 3 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(d) Five from: 5


MP1 Enter the item code
MP2 and check if valid
MP3 Enter number to purchase and check if less than or equal to number
in stock for that item number
MP4 Display error message(s) if needed
MP5 Calculate price to pay
MP6 Using the number to purchase calculate discount
MP7 Check for new customer AND $50 spend/returning customer
eligibility
MP8 application of discount(s) if available
MP9 Check order confirmed
MP10 update appropriate stock level

Sample answer
REPEAT
PRINT "Enter Item Code"
INPUT ItemCode
Found ← False
Count ← 1
REPEAT
IF ItemCode = ItemList(Count} THEN Found ← True
ENDIF
Count ← Count + 1
UNTIL Found OR Count = NoItems
UNTIL Found
REPEAT
PRINT "Enter Number to purchase"
INPUT Number
UNTIL Number > 0 and Number <= Stock(ItemCode)
PriceToPay ← Number * Price (ItemCode)
IF Number >= 10 AND Number < 20 THEN PriceToPay ←
PriceToPay * 0.95 ENDIF
IF Number >= 20 AND Number < 50 THEN PriceToPay ←
PriceToPay * 0.9 ENDIF
IF Number >= 50 AND Number < 100 THEN PriceToPay ←
PriceToPay * 0.75 ENDIF
IF Number >= 100 AND Number < 500 THEN PriceToPay ←
PriceToPay * 0.65 ENDIF
IF Number >= 500 THEN PriceToPay ← PriceToPay * 0.5
ENDIF
PRINT "Enter Value of discount voucher, 0 if no voucher"
INPUT Voucher
PriceToPay ← PriceToPay – Voucher
PRINT "Price to pay is ", PriceToPay
PRINT "Order confirmed? Y/N"
INPUT Confirm
IF Confirm = "Y" THEN Stock(ItemCode) ← Stock(ItemCode)
– Number ENDIF

© UCLES 2019 Page 4 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

1(e) Explanation 5

Five from:
MP1 Search item arrays
MP2 For stock level = 0
MP3 list these as sold out
MP4 Check stock level at end of day with original stock level//search
items sold arrays
MP5 if the same, display/store item code as not sold//if 0,
display/store item code as not sold
MP6 update largest value if greater than existing greatest value
//use max function on items sold array //other method to find
highest number sold
MP7 display this item number with a suitable message

All programming statements used must be explained.

© UCLES 2019 Page 5 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

Section B

2(a) 1 mark for each error identified + suggested correction 4

Count ← 1 should be Count ← 0 or Count >= 500 should be


Count > 500
AND should be OR
Reject ← Reject – 1 should be Reject ← Reject + 1
Reject ← Reject/100 should be Reject ← Reject/5 or Reject
* 100 / 500

2(b) MP1 Add Accept ← 0 at start 4


MP2 Add ELSE Accept ← Accept + 1 after THEN AND Over and
Under defined/position described
OR
Add Accept ← Accept + 1 after THEN AND Replace IF
statement with …<= Over AND …>= UNDER /position described
MP3 Add Accept ← Accept/5 after UNTIL AND correct loop/position
described
MP4 ADD IF Accept < 50 THEN PRINT "Less than 50%
accepted" at end
Accept ← 0
Count ← 1 // 0
Reject ← 0
Over ← 62
Under ← 58
REPEAT
INPUT ItemWeight
IF ItemWeight > Over OR ItemWeight < Under // IF
ItemWeight <= Over AND
ItemWeight >= Under
THEN
Reject ← Reject + 1
ELSE
Accept ← Accept + 1//ELSE not required
ENDIF
Count ← Count + 1
UNTIL Count > 500 // >= 500
Accept ← Accept / 5

IF Accept < 50
THEN
PRINT "Less than 50% accepted"
ENDIF

© UCLES 2019 Page 6 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

3 4
TreadReject Count Depth OUTPUT

0 1

2 1.7

3 1.9

1 4 1.4

5 1.8

6 2.0

Car is potentially roadworthy

TreadReject Count Depth OUTPUT

0 1

1 2 1.2

3 1.9

2 4 1.4

5 1.8

6 2.4

Car is not roadworthy

1 mark for each correct pairs of columns.

© UCLES 2019 Page 7 of 8


0478/23 Cambridge IGCSE – Mark Scheme May/June 2019
PUBLISHED

Question Answer Marks

4 4
Statements Validation Verification

Range check 9

Double entry 9

Check digit 9

Presence check 9

1 mark for each correct row

Question Answer Marks

5 • FOR … TO … NEXT 6
• fixed number of repetitions

• REPEAT … UNTIL
• always executed // condition tested at end

• WHILE … DO … ENDWHILE
• may not be executed // condition tested at beginning

Question Answer Marks

6(a) Number is repeated/not unique 1

6(b) Three from: 7


Train number not displayed
Departure time before 8:30
Criteria of =Y for Platform not required/incorrect
All late trains will be shown/the condition should be on the line above

4 marks, one mark for each correct column

Field: Train Number Platform Departure Time Status

Table: TRAIN TRAIN TRAIN TRAIN

Sort:

Show: ; ; † †
Criteria: > 08:30 = "Late"

or:

© UCLES 2019 Page 8 of 8


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
* 8 6 4 9 8 3 8 3 6 1 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming October/November 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 11 printed pages and 1 blank page.

DC (NH) 162395/3
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material

You have been asked to write a program to calculate the area of a patio and the cost of the stone slabs
needed to cover it. The program should work for any patio that can be represented as a rectangle, or
group of rectangles that are joined together, and only one type of stone slab may be used.

Type of stone slab Price per square metre

Dover $30.00

Exeter $35.00

London $42.00

Portland $49.50

Shaftesbury $55.00

York $62.75

Write and test a program or programs to calculate the cost of the stone slabs for a patio.

• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Setting up the system for a simple rectangular patio.


Set up your program to:
• Store the type and price per square metre of the stone slabs using a suitable programming technique.
• Prompt and allow the user to input the length and width of their patio and the type of stone slab they
would like.
• Calculate and display the number of square metres of stone slabs required, rounded up to the next
whole square metre, and the total cost of the stone slabs.

Task 2 – Working on more complex shapes.


Assuming that a patio can be made up of a group of rectangles, extend your program to:
• Enter the number of rectangles making up the patio and the type of stone slab to be used.
• Allow the dimensions for each rectangle to be entered.
• Calculate and display the total area of the patio rounded up to the next whole square metre.
• Calculate and display the total cost of the stone slabs.

Task 3 – Allowing for waste.


It is likely that some of the stone will not be useable, so it is sensible to allow a percentage for wastage,
for example, 10%. Alter your program to allow the user to input a percentage to calculate wastage and
add this to the number of square metres of stone slabs to be purchased, rounded up to the next whole
square metre. Display the revised total area and cost.
© UCLES 2019 0478/21/O/N/19
3

1 (a) All variables, constants and other identifiers must have meaningful names.

Name two variables that you could have used for Task 1. State the data type and purpose of
each variable.

Variable 1 name ........................................................................................................................

Data type ..................................................................................................................................

Purpose ....................................................................................................................................

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

Variable 2 name ........................................................................................................................

Data type ..................................................................................................................................

Purpose ....................................................................................................................................

...................................................................................................................................................
[6]

(b) Describe how arrays could be used to store the data about the types and price per square
metre of the stone slabs for Task 1.

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

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

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

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

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

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

...............................................................................................................................................[2]

© UCLES 2019 0478/21/O/N/19 [Turn over


4

(c) Write an algorithm to complete Task 2, using either pseudocode, programming statements
or a flowchart. Assume Task 1 has been completed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...................................................................................................................................................
© UCLES 2019 0478/21/O/N/19
5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[5]
© UCLES 2019 0478/21/O/N/19 [Turn over
6

(d) Explain how your program completes Task 3. Any programming statements you use in your
answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[3]
© UCLES 2019 0478/21/O/N/19
7

(e) Name two validation checks that could be used when entering patio dimensions in Task 1 or
Task 2 and describe their purpose.

Validation check 1 .....................................................................................................................

Purpose ....................................................................................................................................

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

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

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

Validation check 2 .....................................................................................................................

Purpose ....................................................................................................................................

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

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

...................................................................................................................................................
[4]

© UCLES 2019 0478/21/O/N/19 [Turn over


8

Section B

2 For each of the four descriptions in the table, place a tick in the correct column to show whether it
describes a Structure diagram, a Flowchart or Library routines.

Structure Library
Description diagram Flowchart routines
A modelling tool used to show the hierarchy of a
system.
A collection of standard programs available for
immediate use.
A graphical representation used to represent an
algorithm.
A graphical representation to show how a system is
broken into sub-systems.
[4]

3 Examine the following pseudocode:

INPUT A
INPUT B
INPUT C
INPUT D
INPUT E
INPUT F
INPUT G
INPUT H
INPUT I
INPUT J
INPUT K
INPUT L
T A + B + C + D + E + F + G + H + I + J + K + L
OUTPUT "The average equals ", T / 12

(a) Describe what happens in this pseudocode.

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

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

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

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

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

...............................................................................................................................................[3]

© UCLES 2019 0478/21/O/N/19


9

(b) Describe how this pseudocode could be altered to allow any number of values to be input.

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

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

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

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

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

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

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

...............................................................................................................................................[3]

(c) Re-write the given pseudocode to allow any number of values to be input.

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

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

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[5]

© UCLES 2019 0478/21/O/N/19 [Turn over


10

4 (a) Complete the trace table for this algorithm using the given input data.

Index 0
FOR Count 0 TO 7
INPUT Value
IF Value > 50
THEN
PassMarks[Index] Value
Index Index + 1
ENDIF
NEXT Count
PRINT "Number passed ", Index

Input data: 58, 40, 67, 85, 12, 13, 75, 82

PassMarks
OUTPUT
Index Count Value [0] [1] [2] [3] [4] [5] [6] [7]

[6]

(b) Give the purpose of the algorithm shown in part (a).

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

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

...............................................................................................................................................[1]

© UCLES 2019 0478/21/O/N/19


11

5 A car manufacturer makes a range of car models named Pegasus, Apollo and Cupid. It keeps a
database to store the records of its range and the different options for each car model. Within the
table CAR_RANGE, the following data needs to be stored:

1. Car model
2. Body style – saloon, hatchback or estate
3. How many doors it has
4. Whether it uses petrol, diesel or batteries as fuel
5. An identifier for a specific car.

(a) Complete the table to show suitable field names and an example of appropriate data for each
field in the database table CAR_RANGE.

Field name Example of data

[3]

(b) State which of your fields would be most appropriate for a primary key and give a reason for
your choice.

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

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

...............................................................................................................................................[2]

(c) Complete the query-by-example grid to provide a list of car models using petrol and the
number of doors these cars have, in alphabetical order of car model. Display only the car
models and the number of doors.

Field:
Table:
Sort:
Show:
Criteria:
or:
[3]

© UCLES 2019 0478/21/O/N/19


12

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/21/O/N/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/21


Paper 2 October/November 2019
MARK SCHEME
Maximum Mark: 50

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 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 8 printed pages.

© UCLES 2019 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

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 descriptors
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.

© UCLES 2019 Page 2 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(a) Two examples of: 6


Any meaningful name for a variable related to Task 1 – one mark
Correct data type related to Task 1 – one mark
Correct purpose related to Task 1 – one mark
e.g.

• Length // Width
• « real
• « to store the length // width of the patio

• StoneType
• « string
• « to store the type of stone slab chosen by the user

• PatioArea
• « integer
• « to store the area of stone needed for the patio

Note: variable names should not contain spaces or punctuation marks

1(b) Two from: 2


• Use of two one-dimensional arrays «
• « with matching indexes
• « each with a specific data types, e.g. string for stone and real for price
• Size of array / number of elements / length of each array is 6
• Meaningful array names, e.g. Stone and Price

© UCLES 2019 Page 3 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(c) Five from: 5


MP1 Prompt and input for number of rectangles making up the patio «
MP2 « and the type of stone to be used
MP3 Loop to input dimensions for rectangles
MP4 Prompt and input for dimensions for each rectangle inside loop
MP5 Calculation of area of a rectangle
MP6 Running total of area of patio
MP7 Looking up the cost of the stone
MP8 Calculation of cost of stone «
MP9 «rounded up to the nearest square metre
MP10 Output of cost of patio with annotation
Example
TotalCost ← 0
OUTPUT "Please enter type of stone needed"
INPUT StoneType
OUTPUT "Please enter the number of rectangles needed"
INPUT NumberRectangle
FOR Counter ← 1 TO NumberRectangle
OUTPUT "Please enter the length"
INPUT Length
OUTPUT "Please enter the Width"
INPUT Width
TotalCost ← TotalCost + CostFromTask1(Length, Width,
StoneType)
// use Task 1 to calculate cost
NEXT Counter
OUTPUT ("Total Cost of Patio " TotalCost

1(d) Three from: 3


• Explanation of user input to name the percentage value to be used
• Explanation of the calculation to add this percentage to the already
calculated quantity of stone required
• Explanation of rounding this value up
• Explanation of the calculation of the new cost
• Explanation of the output that will include annotation, quantity of stone to the
nearest square metre and cost of stone

If only program statements given with no explanation, zero marks.

© UCLES 2019 Page 4 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(e) Two examples of: 4


One mark for each correct validation check related to patio dimensions in Task 1
or Task 2 and one mark for an appropriate related purpose
e.g.

• Range check // Limit check


• « to make sure the dimension is entered is greater than zero and less than
the maximum size

• Type check
• « to make sure any dimension entered is a number

• Presence check
• « to make sure a length/width has been entered for the area of the patio

Question Answer Marks

2 One mark for each correct row 4

Structure Library
Description diagram Flowchart routines

A modelling tool used to show the


9
hierarchy of a system

A collection of standard programs


9
available for immediate use

A graphical representation used to


9
represent an algorithm

A graphical representation to show how


9
a system is broken into sub-systems

© UCLES 2019 Page 5 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

3(a) • Inputs a series of values 3


• Finds the total
• Prints out the average

3(b) Three from: 3


• Use of loop structure
• Allow input to define the limit of the loop / use sentinel value
• Keeping a count of the number of values
• It could use a totalling process to keep a running total

3(c) Marks awarded as follows (maximum five marks): 5


• Initialise Total
• Enter limit
• Suitable loop structure
• Correct input
• Correct totalling
• Correct output
e.g.

Total ← 0
INPUT CounterLimit
FOR LoopCounter ← 1 To CounterLimit
INPUT Number
Total ← Total + Number
NEXT LoopCounter
OUTPUT ″The average equals ″, Total / CounterLimit

© UCLES 2019 Page 6 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

4(a) Index Count Value PassMarks 6


OUTPUT

[0] [1] [2] [3] [4] [5] [6] [7]

0 0 58 58

1 1 40

1 2 67 67

2 3 85 85

3 4 12

3 5 13

3 6 75 75

4 7 82 82

5 Number
passed 5

1 1 1 1 1 1
mark mark mark mark mark mark

4(b) One from: 1


• Stores numbers greater than 50 in an array
• Outputs number of times pass mark has been met
• Find the number of pass marks

© UCLES 2019 Page 7 of 8


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

5(a) 3
Field name Example of data

CarID ID07

Model Pegasus // Apollo // Cupid

BodyStyle estate //saloon // hatchback

Doors 1 // 2 // 3 // 4 // 5

FuelType batteries // petrol // diesel

One mark – 1 or 2 suitable names and corresponding examples of data // 5


suitable field names but all data incorrect
Two marks – 3 or 4 suitable names and corresponding examples of data
Three marks – 5 suitable names and corresponding examples of data
Notes: CarID can be anything that could be used as a unique identifier. e.g.
Number Plate
Number of doors can be any number of sensible doors for a car – 1, 2, 3, 4, 5.
Other data must come from the given text. Allow codes for model and body style.

5(b) • CarID 2
• Which contains unique values to identify each record

5(c) 3
Field: Model FuelType Doors

Table: CAR_RANGE CAR_RANGE CAR_RANGE

Sort: Ascending

Show: ; † ; † †
Criteria: ="Petrol"

or:

1 mark for each completely correct column (maximum three marks)

© UCLES 2019 Page 8 of 8


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
* 1 9 5 1 2 3 8 0 2 2 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming October/November 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 13 printed pages and 3 blank pages.

DC (ST/CT) 162455/3
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material

A company supplies concrete slabs for paving. The slabs are made to order in batches of 20;
all slabs in a batch are identical. Customers can order from a small range of standard sizes and
colours. All measurements are given in millimetres. The price is calculated at $0.05 for a volume of
100 000 mm3 of grey concrete; red and green concrete are charged at 10% more. Customers can
choose their own colours; a custom colour has an initial set up cost of $5 then 15% more than the
price for grey.

Colour of Depth of
Shapes Sizes for each shape
slab slab
Grey 38 Square 600 × 600 or 450 × 450
Red 45 Rectangular 600 × 700 or 600 × 450
Green Round Diameter 300 or 450
Custom

Write and test a program or programs for the concrete slab company.

• Your program or programs must include appropriate prompts for the entry of data; data must
be validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Price for a batch of 20 slabs

Using the information above set up a routine that allows a customer to choose the concrete slab
they require and calculate a price for a batch of 20 slabs. The details of the slab chosen and the
price for a batch of 20 should be displayed on the screen.

Task 2 – Customer places an order

Using the information from TASK 1, the customer places an order for the number of slabs they
require. Orders for fewer than 20 slabs or more than 100 slabs are not accepted; orders that are
not a multiple of 20 are rounded up to the next multiple of 20 slabs. Display the order price and the
number of slabs to be produced.

Task 3 – Flexible pricing

The cost of concrete is variable. The cost for 100 000 mm3 of grey concrete can be input and two
grades are available; basic at the cost input and best at 7% more. Use a copy of your program for
TASK 1 to develop TASK 3 to input the cost and grade of concrete before calculating the price for
20 slabs.

© UCLES 2019 0478/22/O/N/19


3

1 (a) All variables, constants and other identifiers must have meaningful names.

(i) Describe the data structures that you have used to store the data for the concrete slabs
in Task 1, include the name, data type and use for each data structure.

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

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

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

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

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

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

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

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

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

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

..................................................................................................................................... [5]

(ii) State one variable that you have used in Task 3.


Give the data type for the variable. State what it is used for.

Variable name ...................................................................................................................

Data type ...........................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................
[3]

(b) Explain how you calculated the volume of a concrete slab in Task 1.

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

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

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

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

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

............................................................................................................................................. [3]

© UCLES 2019 0478/22/O/N/19 [Turn over


4

(c) Write an algorithm for Task 2, using either pseudocode, programming statements or a
flowchart. Assume that Task 1 has been completed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...................................................................................................................................................
© UCLES 2019 0478/22/O/N/19
5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]
© UCLES 2019 0478/22/O/N/19 [Turn over
6

(d) Explain how you changed your program for Task 1 to meet the requirements for Task 3.
Include and fully explain any altered or additional programming statements.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [4]
© UCLES 2019 0478/22/O/N/19
7

Section B

2 An algorithm has been written in pseudocode to select a random number using the function
RandInt(n), which returns a whole number between 1 and the argument n. The algorithm then
allows the user to guess the number.

Number RandInt(100)
TotalTry 1
REPEAT
PRINT "Enter your guess now, it must be a whole number"
INPUT Guess
IF TotalTry > Number
THEN
PRINT "Too large try again"
ENDIF
IF Guess > Number
THEN
PRINT "Too small try again"
ENDIF
TotalTry Guess + 1
UNTIL Guess <> Number
TotalTry TotalTry - 1
PRINT "Number of guesses ", TotalTry

Find the four errors in the pseudocode and suggest a correction to remove each error.

Error 1 ..............................................................................................................................................

Correction .........................................................................................................................................

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

Error 2 ..............................................................................................................................................

Correction .........................................................................................................................................

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

Error 3 ..............................................................................................................................................

Correction .........................................................................................................................................

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

Error 4 ..............................................................................................................................................

Correction .........................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2019 0478/22/O/N/19 [Turn over


8

3 (a) The flowchart checks the lengths of a batch of 10 ropes. For the batch to be accepted 90% of
the lengths need to be between 24.9 and 25.1 metres.

START

Reject 0
Count 0

Yes
Is Count =
10 ?
No
No
Count Count + 1 Is Reject
<= 1 ?
INPUT Length
Yes
OUTPUT "Batch
rejected"

Yes Is Length <


25.1 AND
Length > 24.9 ?

No

Reject Reject + 1

OUTPUT "Batch
accepted"

END

© UCLES 2019 0478/22/O/N/19


9

Complete the trace table for the input data:

24.88, 25.01, 24.98, 25.00, 25.05, 24.99, 24.97, 25.04, 25.19, 25.07

Reject Count Length OUTPUT

[4]

(b) (i) It has been decided to only reject batches of rope that contain ropes that are too short.

State the change required to the algorithm.

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

..................................................................................................................................... [1]

(ii) Explain how the algorithm to reject batches could be improved to make it more effective.

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

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

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

..................................................................................................................................... [2]

© UCLES 2019 0478/22/O/N/19 [Turn over


10

4 Four validation checks and four descriptions are shown.

Draw a line to connect each validation check to the correct description.

Validation Check Description

Range check Checks that some data is entered.

Checks for a maximum number of characters


Presence check
in the data entered.

Checks that the characters entered are all


Length check
numbers.

Checks that the value entered is between an


Type check
upper value and a lower value.
[3]

5 A programmer writes a program to weigh baskets of fruit in grams, keeping a total of the weight
and counting the number of baskets. The total weight is stored in a variable Total and the number
of baskets is stored in a variable BasketCount.

Explain, including examples of programming statements, how totalling and counting could be used
in this program.

Totalling .............................................................................................................................................

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

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

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

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

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

Counting ...........................................................................................................................................

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

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

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

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

..........................................................................................................................................................
[4]

© UCLES 2019 0478/22/O/N/19


11

6 Explain why constants, variables and arrays are used in programming.

Constants .........................................................................................................................................

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

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

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

Variables ..........................................................................................................................................

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

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

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

Arrays ...............................................................................................................................................

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

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

..........................................................................................................................................................
[6]

© UCLES 2019 0478/22/O/N/19 [Turn over


12

7 A database table, SALES, is used to keep a record of items made and sold by a furniture maker.

Item number Order number Notes Amount Status


CH001 1921 Smith – six dining chairs 6 Delivered
TB003 1921 Smith – large table 1 In progress
CH001 1924 Hue – extra chairs 4 In progress
CH003 1925 For stock 2 Cancelled
BN001 1927 Patel – replacement bench 1 Not started
ST002 1931 Sola – small table 1 Delivered
CH003 1927 Patel – eight dining chairs with arms 8 Not started
TB003 1927 Patel – large table 1 Not started

(a) Explain why the field Item number could not be used as a primary key.

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

............................................................................................................................................. [1]

© UCLES 2019 0478/22/O/N/19


13

(b) A query-by-example has been written to display only the order number and item numbers of
any items in progress or not started.

Field: Item number Order number Amount Status


Table: SALES SALES SALES SALES
Sort:
Show: 3 3
Criteria: Not Like "Delivered"
or:

Explain why the query-by-example is incorrect, and write a correct query-by-example.

Explanation ...............................................................................................................................

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

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

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

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

Field:
Table:
Sort:
Show:
Criteria:
or:
[5]

© UCLES 2019 0478/22/O/N/19


14

BLANK PAGE

© UCLES 2019 0478/22/O/N/19


15

BLANK PAGE

© UCLES 2019 0478/22/O/N/19


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/22/O/N/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/22


Paper 2 October/November 2019
MARK SCHEME
Maximum Mark: 50

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 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 7 printed pages.

© UCLES 2019 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

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 descriptors
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.

© UCLES 2019 Page 2 of 7


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Section A

Question Answer Marks

1(a)(i) Data Structure(s) maximum two marks 5


• Array
• Variable
• Constant

Description maximum three marks


• Name(s) one or more e.g. Colour
• Data type(s) one or more e.g. String
• Use(s) one or more e.g. To store the colour of the slab

Additional data structure description using the same data structure type
maximum one mark
• Two or more full descriptions of the data structure including name, data type
and use

1(a)(ii) • Variable name e.g. ConcretePrice 3


• Data type e.g. Real
• Use e.g. To store the price of the grade of concrete

1(b) Three from: 3


• Using the shape, size and depth «
• « the area of the shape is found «
• « for all except round multiply length by breadth/show example «
• « for round multiply Pi by half the diameter/radius squared «
• « multiply the area by the depth to give the volume

© UCLES 2019 Page 3 of 7


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(c) Five from: 5


MP1 Enter number of slabs to purchase with prompt
MP2 Check if less than 20 or greater than 100 «
MP3 « if so, reject the number and re-enter a value
MP4 Attempt to round the number of slabs to the next 20 «
MP5 Accurate attempt to round up to the next 20
MP6 Calculate the number of batches
MP7 Calculate price to pay (number of batches × price per batch from
Task 1)
MP8 Display price and number of slabs produced «
MP9 « Suitable output message(s)

Sample answer
REPEAT
PRINT "Enter Number of slabs to purchase"
INPUT Number
UNTIL Number >= 20 and Number <= 100
PurchaseNo  Number
IF Number > 20 AND Number <= 40 THEN PurchaseNo  40 ENDIF
IF Number > 40 AND Number <= 60 THEN PurchaseNo  60 ENDIF
IF Number > 60 AND Number <= 80 THEN PurchaseNo  80 ENDIF
IF Number > 80 THEN PurchaseNo  100 ENDIF
BatchNo  PurchaseNo / 20
PriceToPay  BatchNo * BatchPrice //BatchPrice calculated
in Task 1
PRINT "Price for ", PurchaseNo, " Slabs is $", PriceToPay

1 (d) Four from explanations: 4


• Enter the price of the concrete
• Store the price of the concrete
• Set up variable(s) for grades
• Input the grade
• The price that is input is used in the final price calculation instead of 0.05
• The price calculation depends on the grade input e.g. 1.07 × price or
price + price × 0.07 for Best

If no programming code seen to support at least one explanation maximum of


three marks can be awarded.

© UCLES 2019 Page 4 of 7


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Section B

Question Answer Marks

2 One mark for each error identified and suggested correction: 4


• IF TotalTry > Number should be IF Guess > Number
• IF Guess > Number should be IF Guess < Number
• TotalTry ← Guess + 1 should be TotalTry ← TotalTry + 1
• UNTIL Guess <> Number should be UNTIL Guess = Number

Question Answer Marks

3(a) Reject Count Length 4


OUTPUT

0 0

0 1 24.88

1 2 25.01

1 3 24.98

1 4 25.00

1 5 25.05

1 6 24.99

1 7 24.97

1 8 25.04

1 9 25.19

2 10 25.07 Batch rejected

One mark for each correct column max. 4

3(b)(i) • Remove Length < 25.1 AND 1

3(b)(ii) Two from: 2


• Check the reject counter after each incrementation/remove reject check
after counter = 10 «
• « as soon as Reject = 2 / >1 ...
• « reject batch and end

© UCLES 2019 Page 5 of 7


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

4 3

One mark for each correct line, up to maximum of three marks.

Question Answer Marks

5 Totalling: 4
• Adding the weight of each basket to the total weight as each weight is
entered
• Total = Total + Weight

Counting:
• Adding one to/incrementing the number of baskets as each weight is
entered
• BasketCount = BasketCount + 1

© UCLES 2019 Page 6 of 7


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

6 Constants 6
Two from:
• The value cannot be changed accidentally «
• « during the execution of the program
• Value only needs to be changed once if circumstances change/during the
initialisation process

Variables
Two from:
• Stores a value that can change «
• « during the execution of the program
• Can use a variable without knowing its value

Arrays
Two from:
• A list of items of the same data type «
• « stored under a single name
• To reduce the number of variables used
• Any item can be found using an index number to show its place in the list

Question Answer Marks

7(a) • Number is repeated/not unique 1

7(b) • Item number not displayed/Amount column not required 5


• Not Like ‘Delivered’ will also show cancelled items

Field: Item number Order number Status

Table: SALES SALES SALES

Sort:

Show:
; ; † †
Criteria: Like "Not
started"

or: Like "In


progress"

• Correct Item number column


• Correct Order number column and any additional column not shown
• Correct status column

© UCLES 2019 Page 7 of 7


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education
* 5 6 8 7 7 5 5 2 9 2 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming October/November 2019
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No calculators allowed.

READ THESE INSTRUCTIONS FIRST

Write your centre number, candidate number and name in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams, graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.

DO NOT ATTEMPT TASKS 1, 2 AND 3 in the pre-release material; these are for information only.

You are advised to spend no more than 40 minutes on Section A (Question 1).

No marks will be awarded for using brand names of software packages or hardware.

Any businesses described in this paper are entirely fictitious.

At the end of the examination, fasten all your work securely together.

The number of marks is given in brackets [ ] at the end of each question or part question.

The maximum number of marks is 50.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 12 printed pages.

DC (SC) 162458/3
© UCLES 2019 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material

You have been asked to write a program to calculate the area of a wall and the cost of the tiles
needed to cover it. The program should work for any room with up to four walls being tiled. Tiles are
sold in boxes; each box covers one square metre.

Tile description Price per box


Small black granite $19.50
Small grey marble $25.95
Small powder blue $35.75
Medium sunset yellow $12.50
Medium berry red $11.00
Medium glitter purple $52.95
Large oak wood effect $65.00
Large black granite $58.98
Large bamboo effect $85.00
Extra-large white marble $62.75
Write and test a program or programs to calculate the area of the walls and the cost of tiles needed
to tile a room.

• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All arrays, variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Setting up and using the system for a single wall.


Set up your program to:
• Store the tile description, price per box and an identification code using a suitable programming
technique.
• Display the list of tiles including the identification code, description and price per box.
• Prompt the user to input the height and width of the wall, and the identification code of the tiles
they would like.
• Calculate and display the area of the wall, the number of boxes of tiles required (tiles are sold in
boxes of complete square metres) and the total cost of the tiles.

Task 2 – Adding additional walls.


Extend your program to:
• Enter the number of walls to be tiled and the identification code of the tiles to be used. Only one
identification code to be used for all walls.
• Enter the dimensions for each wall to be tiled.
• Calculate and display the total area of all walls, the number of boxes of tiles required (tiles are
sold in boxes of complete square metres) and the total cost of the tiles.

Task 3 – Allowing for waste.


It is likely that some of the tiles will not be useable so it is sensible to allow a percentage for wastage,
for example 10%. Alter your program to allow the user to input a percentage to calculate wastage
and add this to the total area to be tiled. Calculate and display the revised number of boxes of tiles
to be purchased (tiles are sold in boxes of complete square metres) and the total cost of the tiles.
© UCLES 2019 0478/23/O/N/19
3

1 (a) All variables, constants and other identifiers must have meaningful names.

Name two arrays you could use for Task 1. State the data type and purpose of each one.

Array 1 ......................................................................................................................................

Data type 1 ...............................................................................................................................

Purpose ....................................................................................................................................

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

Array 2 ......................................................................................................................................

Data type 2 ...............................................................................................................................

Purpose ....................................................................................................................................

...................................................................................................................................................
[4]

(b) Name a variable that you used for Task 2. State the data type and purpose of this variable.
Explain why you chose to use a variable rather than a constant.

Variable .....................................................................................................................................

Data type ..................................................................................................................................

Purpose ....................................................................................................................................

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

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

Reason for use of a variable .....................................................................................................

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

...................................................................................................................................................
[4]

© UCLES 2019 0478/23/O/N/19 [Turn over


4

(c) Write an algorithm for Task 1, using either pseudocode, programming statements or a
flowchart. Assume that the first part of Task 1, the storage and display of tile descriptions,
prices per box and identification codes has already been done.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2019 0478/23/O/N/19


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [6]
© UCLES 2019 0478/23/O/N/19 [Turn over
6

(d) Explain how you extended your program to complete Task 2. Any programming statements
you use in your answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [3]
© UCLES 2019 0478/23/O/N/19
7

(e) Explain how you could validate the input for percentage waste allowance in Task 3.

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

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

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

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

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

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

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

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

............................................................................................................................................. [3]

© UCLES 2019 0478/23/O/N/19 [Turn over


8

Section B

2 Describe the use of a subroutine in a program.

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

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

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

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

.................................................................................................................................................... [2]

3 Name the three types of loop structure used in pseudocode.

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

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

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

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

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

.................................................................................................................................................... [3]

© UCLES 2019 0478/23/O/N/19


9

4 The following pseudocode algorithm uses nested IF statements.

IF Response = 1
THEN
X X + Y
ELSE
IF Response = 2
THEN
X X – Y
ELSE
IF Response = 3
THEN
X X * Y
ELSE
IF Response = 4
THEN
X X / Y
ELSE
OUTPUT "No response"
ENDIF
ENDIF
ENDIF
ENDIF

(a) Name the type of statement demonstrated by the use of IF … THEN … ELSE … ENDIF

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

............................................................................................................................................. [1]

(b) Re-write the pseudocode algorithm using a CASE statement.

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [4]

© UCLES 2019 0478/23/O/N/19 [Turn over


10

5 The algorithm performs an operation on the array named MyData

DIV means integer division, so only the whole number part of the result is returned
e.g. 7 DIV 2 returns a value of 3

First 0
Last 16
Found FALSE
INPUT UserIn
WHILE (First <= Last) AND (Found = FALSE) DO
Middle (First + Last) DIV 2
IF MyData[Middle] = UserIn
THEN
Found TRUE
ELSE
IF UserIn < MyData[Middle]
THEN
Last Middle - 1
ELSE
First Middle + 1
ENDIF
ENDIF
ENDWHILE
OUTPUT Found

This table shows the contents of the array: MyData e.g. MyData[2] stores the value 5

MyData
Index [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
Value 2 3 5 6 8 10 12 13 14 16 18 20 25 27 29 34 36

(a) Complete the trace table for the input data: 10

First Last UserIn Middle Found OUTPUT

[6]

(b) Describe the function being performed by the algorithm.

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

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

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

............................................................................................................................................. [2]
© UCLES 2019 0478/23/O/N/19
11

6 Draw four different flowchart symbols and describe how they are used in a program flowchart.

Flowchart symbol Description of use

[4]

© UCLES 2019 0478/23/O/N/19 [Turn over


12

7 A teacher has decided to use a database table as her mark book for her Computer Science class,
which she has called MARKBOOK. For each student, the following data will be recorded: first
name, last name, their year 10 test score and their year 11 test score. The class has 32 students.

(a) State the number of fields and records required for this database.

Number of Fields ......................................................................................................................

Number of Records ..................................................................................................................


[2]

(b) The data in MARKBOOK is stored under category headings: LastName, FirstName,
Y10TestScore and Y11TestScore.

State, with a reason, whether any of these headings would be suitable as a primary key.

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

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

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

............................................................................................................................................. [2]

(c) Complete the query-by-example grid to only display the first name, last name and year 10
test score of each student who achieved 50 or more in their year 10 test. The output should
be in test score order with the highest marks at the top of the list.

Field:

Table:

Sort:

Show:
Criteria:

or:
[4]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 0478/23/O/N/19


Cambridge Assessment International Education
Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/23


Paper 2 October/November 2019
MARK SCHEME
Maximum Mark: 50

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 2019 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This syllabus is regulated for use in England, Wales and Northern Ireland as a Cambridge International Level 1/Level 2 Certificate.

This document consists of 8 printed pages.

© UCLES 2019 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

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 descriptors
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.

© UCLES 2019 Page 2 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(a) Two examples of: 4


Any meaningful name for an array related to Task 1 – one mark, e.g.
• TileDescription
• TilePrice
• TileCode
Correct data type and purpose related to Task 1 – one mark, e.g.
• « string to store the name / description of the tiles
• « real to store the price of the tiles
• « string to store the tile codes

1(b) Any meaningful name for a variable related to Task 2 – one mark, e.g. 4
• NumberOfWalls
• TotalArea
• TotalCost

Relevant data type for the variable related to Task 2 – one mark, e.g.
• « Integer
• « Real

Relevant purpose for the variable related to Task 2 – one mark, e.g.
• « to store the number of walls that need to be tiled
• « to store the total area / cost

One mark for a correct reason, e.g.


• Variables allow the storage of values within a program that may change as
the program runs // Variables are used to store values that are input or
calculated

© UCLES 2019 Page 3 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(c) Six from: 6


MP1 Input for height and width of the wall to tile and tile code
MP2 Prompts for all inputs seen
MP3 Validation of height and width
MP4 Reasonable attempt at validation of tile code
MP5 Calculation of the area of the wall
MP6 Calculation of the number of boxes rounded up
MP7 Looking up the cost of the tiles
MP8 Calculation of the cost of the boxes of the tiles
MP9 Output of area of the wall, the number of boxes and cost of tiles
needed
MP10 Appropriate message(s) with output

Example algorithm
REPEAT
OUTPUT "Please enter height of wall "
INPUT Height
UNTIL Height > 0

REPEAT
OUTPUT "Please enter width of wall "
INPUT Width
UNTIL Width > 0

REPEAT
Found ← FALSE
Counter ← 0
REPEAT
OUTPUT "Please enter tile identification code "
INPUT MyTileId
IF MyTileId = TileCode(Counter)
THEN
MyCost ← TilePrice(Counter)
Found ← TRUE
ENDIF
Counter ← Counter + 1
UNTIL Found OR Counter = 10
UNTIL Found

Area ← Height * Width


NoBoxes ← Int(Round (Area + 0.5))
// Rounds up to nearest Integer
TotalPrice ← NoBoxes * MyCost

OUTPUT ("Area of wall is ", Area, " metres")


OUTPUT ("Number of boxes of tiles is ", Area, " NoBoxes)
OUTPUT ("Cost of Tiles is ", TotalPrice, " dollars"

© UCLES 2019 Page 4 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

1(d) Three from: 3


• Adding an extra user input for number of walls «
• « using this value as a loop counter
• « so that separate inputs of height and width can be made for each wall
• Calculating a running total for the final area using the results of the area
calculation for each wall
• Rounding the final area or using previously rounded areas for the final total
• Displaying with a suitable message final area, final number of boxes of tiles
required and final cost

If only program statements given with no explanation, zero marks.

1(e) Three from: 3


• Check that only numbers are accepted // type check
• Check that the values are within boundaries // range check
• Check that a value has been entered // presence check
• Using an IF / conditional statement
• Identification of suitable lower value / acceptable value
• Identification of suitable upper value / unacceptable value
• Alerting the user with an error message if the input is unacceptable

© UCLES 2019 Page 5 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

2 Two from 2
• Sub-program / system not the whole program / system
• To perform a frequently used operation within a program
• That can be called when needed
• That can be reused by another program

Question Answer Marks

3 • FOR (… TO … NEXT)loop 3
• WHILE (… DO … ENDWHILE) loop
• REPEAT (… UNTIL) loop

Question Answer Marks

4(a) • Conditional / selection statement 1

4(b) Four from: 4


MP1 CASE statement with identifier Response
MP2 Correct structure used for choices«
MP3 «. correct statements used for choices
MP4 OTHERWISE and correct statement
MP5 Single ENDCASE included
e.g.
CASE OF Response // CASE Response OF
1 : X ← X + Y
2 : X ← X - Y
3 : X ← X * Y
4 : X ← X / Y
OTHERWISE OUTPUT ″No response″
ENDCASE

Question Answer Marks

5(a) First Last UserIn Middle Found 6


OUTPUT

0 16 FALSE

0 16 10 8 FALSE

0 7 10 3 FALSE

4 7 10 5 TRUE TRUE

One mark per correct column

© UCLES 2019 Page 6 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

5(b) Two from: 2


• Search for the value input «
• « using an array«
• « of sorted data

Question Answer Marks

6 One mark for each correct symbol and name / description / example of use 4
(maximum four marks)

Symbol Description of use

Terminator – start / end the


flowchart

Process – to show calculations,


etc.

Input / Output

Decision – to show condition

Continuation – to extend the


flowchart and allow it to join up

© UCLES 2019 Page 7 of 8


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2019

Question Answer Marks

7(a) • Number of Fields: 4 2


• Number of Records: 32

7(b) • No field is suitable as a primary key « 2


• « because none of the data would be unique // duplicates could occur

7(c) 4
Field: FirstName LastName Y10TestScore

Table: MARKBOOK MARKBOOK MARKBOOK

Sort: Descending

Show:
; ; ; †
Criteria: >=50

or:

One mark for each completely correct column down to and including ‘Show’ row
(maximum three marks)
One mark for correct search criteria rows

© UCLES 2019 Page 8 of 8


Cambridge IGCSE™
* 1 4 8 0 2 6 2 6 5 1 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming May/June 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Blank pages are indicated.

DC (CJ/CB) 185166/3
© UCLES 2020 [Turn over
2

Section A
You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material

A shop sells a range of mobile devices, SIM cards and accessories as shown in the table:
Category Item code Description Price ($)
Phone BPCM Compact 29.99
Phone BPSH Clam Shell 49.99
Phone RPSS RoboPhone – 5-inch screen and 64 GB memory 199.99
Phone RPLL RoboPhone – 6-inch screen and 256 GB memory 499.99
Phone YPLS Y-Phone Standard – 6-inch screen and 64 GB memory 549.99
Phone YPLL Y-Phone Deluxe – 6-inch screen and 256 GB memory 649.99
Tablet RTMS RoboTab – 8-inch screen and 64 GB memory 149.99
Tablet RTLM RoboTab – 10-inch screen and 128 GB memory 299.99
Tablet YTLM Y-Tab Standard – 10-inch screen and 128 GB memory 499.99
Tablet YTLL Y-Tab Deluxe – 10-inch screen and 256 GB memory 599.99
SIM card SMNO SIM Free (no SIM card purchased) 0.00
SIM card SMPG Pay As You Go (SIM card purchased) 9.99
Case CSST Standard 0.00
Case CSLX Luxury 50.00
Charger CGCR Car 19.99
Charger CGHM Home 15.99

Write and test a program or programs for this shop.


• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All arrays, variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the system.
Write a program to:
• use appropriate data structures to store the item code, description and price information for the
mobile devices, SIM cards and accessories
• allow the customer to choose a specific phone or tablet
• allow phone customers to choose whether the phone will be SIM Free or Pay As You Go
• allow the customer to choose a standard or luxury case
• allow the customer to choose the chargers required (none, one or both may be purchased)
• calculate the total price of this transaction
• output a list of the items purchased and the total price.
Task 2 – Allow a customer to order multiple mobile devices.
Extend Task 1 to:
• offer the customer the opportunity to purchase an additional mobile device
• if required, perform bulleted steps 2 to 7 of Task 1 for each additional mobile device and
calculate a running total for the customer
• once no further devices are required, output the total the customer will need to pay.
Task 3 – Offering discounts.
Extend the program to allow a discount of 10% off the price of every additional phone or tablet
purchased.
Output the new total the customer will need to pay and the amount of money saved.

© UCLES 2020 0478/21/M/J/20


3

1 All variables, constants and other identifiers must have meaningful names.

(a) (i) Identify two arrays you could have used for Task 1 and, in each case, state its purpose.

Array 1 ...............................................................................................................................

Purpose .............................................................................................................................

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

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

Array 2 ...............................................................................................................................

Purpose .............................................................................................................................

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

...........................................................................................................................................
[4]

(ii) Identify two variables you could have used for Task 1 and, in each case, state its
purpose.

Variable 1 ..........................................................................................................................

Purpose .............................................................................................................................

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

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

Variable 2 ..........................................................................................................................

Purpose .............................................................................................................................

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

...........................................................................................................................................
[4]

(b) Explain why the item code data could not be stored as a real data type and identify the most
suitable data type for the item code data.

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

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

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

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

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

............................................................................................................................................. [2]

© UCLES 2020 0478/21/M/J/20 [Turn over


4

(c) Write an algorithm to show how you input your choice of mobile device and SIM card (part of
Task 1), using either pseudocode, programming statements or a flowchart. It is not necessary
to show initialisation or setting up of arrays containing product details.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2020 0478/21/M/J/20


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

............................................................................................................................................. [5]
© UCLES 2020 0478/21/M/J/20 [Turn over
6

(d) Explain how your program completes Task 3. Any programming statements used in your
answer must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

© UCLES 2020 0478/21/M/J/20


7

Section B starts on page 8.

© UCLES 2020 0478/21/M/J/20 [Turn over


8

Section B

2 Tick (ü) one box in each row to identify if the statement about structure diagrams is true or false.

True False
Statement
(ü) (ü)
A structure diagram is a piece of code that is available throughout the
structure of a program.
A structure diagram shows the hierarchy of a system.

A structure diagram is another name for an array.

A structure diagram shows the relationship between different components


of a system.
[2]

3 Programs can perform validation and verification checks when data is entered.

(a) Give the names of two different validation checks and state the purpose of each one.

Check 1 .....................................................................................................................................

Purpose .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Check 2 .....................................................................................................................................

Purpose .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

(b) Give the name of one verification check.

............................................................................................................................................. [1]

(c) Describe the difference between validation and verification.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/21/M/J/20


9

4 The pseudocode algorithm shown should allow numbers to be entered and should allow
50 numbers to be stored in an array.

Count 0 ←
REPEAT
INPUT Values[Count]
Count ←
Count + 1
UNTIL Count = 0

(a) Explain why the algorithm will never end.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(b) Re-write the original pseudocode so that it terminates correctly and also prevents numbers
below 100 from being stored in the array Values[ ]

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(c) Describe how you could change your pseudocode in part (b) so that it prevents numbers
below 100 and above 200 from being stored in the array Values[ ]

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/21/M/J/20 [Turn over


10

5 The flowchart represents an algorithm.

The predefined function DIV gives the value of the result of integer division,
for example, y ← 9 DIV 4 gives y a value of 2

An input value of –1 ends the algorithm.

START

INPUT
Value

IS Yes
Value =
-1 ?

No

Calc1 Value DIV 2

Calc2 Value DIV 3

IS
No Calc1 =
Value / 2 ?

Yes

IS
No Calc2 =
Value / 3 ?

Yes

OUTPUT
Value
END

© UCLES 2020 0478/21/M/J/20


11

(a) Complete the trace table for the input data:

50, 33, 18, 15, 30, –1, 45, 12, 90, 6

Value Calc1 Calc2 OUTPUT

[4]

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/21/M/J/20 [Turn over


12

6 A garden centre sells garden tools and stores details of these in a database table named TOOLS.
Code is the primary key in the TOOLS table.

Code Description Price ($) Quantity_Stock Quantity_Ordered


GFLG Garden Fork 50.00 1 50
GSLG Garden Spade 50.00 11 0
GHLG Garden Hoe 45.00 8 0
HFSM Hand Fork 9.99 42 0
HSSM Hand Spade 9.99 40 0
HWSM Hand Weeder 9.99 11 0
HS20 Hose (20 metres) 45.00 10 0
HS35 Hose (35 metres) 60.00 2 0
HS50 Hose (50 metres) 75.00 20 60
YBLG Yard Brush 24.99 100 0
LMHD Lawn Mower 99.99 5 0
LMBT Lawn Mower (Battery) 249.99 7 0
LMPT Lawn Mower (Petrol) 349.99 10 25
TRBT Edge Trimmer (Battery) 79.99 15 0
TRPT Edge Trimmer (Petrol) 59.99 20 0
SHSM Shears 40.00 40 0
HCSM Hedge Clippers 40.00 45 0

(a) State the purpose of the primary key in the TOOLS table.

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2020 0478/21/M/J/20


13

(b) List the output from the data shown in the table TOOLS that would be given by this query-by-
example.

Field: Code Description Price ($) Quantity_Stock Quantity_Ordered

Table: TOOLS TOOLS TOOLS TOOLS TOOLS

Sort: Descending

Show: ü ü ü
Criteria: >40 >0 >0

or:

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Complete the query-by-example grid to output the tools where the quantity in stock is below
25. Only show the Code, Description and Quantity_Stock fields in ascending order of Code.

Field:

Table:

Sort:

Show:

Criteria:

or:

[3]

© UCLES 2020 0478/21/M/J/20


14

BLANK PAGE

© UCLES 2020 0478/21/M/J/20


15

BLANK PAGE

© UCLES 2020 0478/21/M/J/20


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/21/M/J/20


Cambridge IGCSE™

COMPUTER SCIENCE 0478/21


Paper 2 May/June 2020
MARK SCHEME
Maximum Mark: 50

Published

Students did not sit exam papers in the June 2020 series due to the Covid-19 global pandemic.

This mark scheme is published to support teachers and students and should be read together with the
question paper. It shows the requirements of the exam. The answer column of the mark scheme shows the
proposed basis on which Examiners would award marks for this exam. Where appropriate, this column also
provides the most likely acceptable alternative responses expected from students. Examiners usually review
the mark scheme after they have seen student responses and update the mark scheme if appropriate. In the
June series, Examiners were unable to consider the acceptability of alternative responses, as there were no
student responses to consider.

Mark schemes should usually be read together with the Principal Examiner Report for Teachers. However,
because students did not sit exam papers, there is no Principal Examiner Report for Teachers for the June
2020 series.

Cambridge International will not enter into discussions about these mark schemes.

Cambridge International is publishing the mark schemes for the June 2020 series for most Cambridge
IGCSE™ and Cambridge International A & AS Level components, and some Cambridge O Level
components.

This document consists of 10 printed pages.

© UCLES 2020 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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 descriptors 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.

© UCLES 2020 Page 2 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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.

© UCLES 2020 Page 3 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(a)(i) Any meaningful array related to Task 1 – one mark (max two) e.g. 4
ItemCode
Description

Correct purpose for each array related to Task 1 – one mark (max two) e.g.
…to store the item codes
…to store the descriptions of the items for sale

1(a)(ii) Any meaningful variable related to Task 1 – one mark (max two) e.g. 4
PurchaseItem
TotalPrice

Correct purpose for each variable related to Task 1 - one mark (max two) e.g.
… to allow input of an item/code for purchase
… to store/calculate the total price of the transaction

1(b) Any one correct statement e.g. 2


• The Code data is made up of letters/alphabetic characters/not numbers
• Real data must have numerical value/would not be used in calculations

One mark for:


• String

© UCLES 2020 Page 4 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) Any five from 5


• Input with message to allow choice of mobile device
• Attempt to validate input to check for valid item code
• Accurate validation of input to check for valid item code
• Determination of whether device is phone or tablet
• Restriction to only allow input for SIM card required if mobile device is a phone
• Input with message to find out if a SIM card is required

Example answer
OUTPUT "Which type of phone or tablet would you like? Input the Item Code"
DeviceFlag ← False
WHILE DeviceFlag = False
INPUT DeviceCode
Count ← 0
WHILE Count<10 DO
IF DeviceCode = ItemCode[Count]
THEN
IF Count < 6
THEN
DeviceType ← "Phone"
ELSE
DeviceType ← "Tablet"
ENDIF
DeviceFlag ← True
Count ← 10
ENDIF
Count ← Count + 1
ENDWHILE
IF DeviceFlag = False
THEN

© UCLES 2020 Page 5 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) OUTPUT "Your code doesn’t exist, please try again"


ENDIF
ENDWHILE
IF DeviceType ← "Phone"
THEN
OUTPUT "Would you like a SIM Card? (Answer Y or N)"
INPUT SimRequired
ENDIF

1(d) Any five from 5


• Explanation of finding if more than one device is purchased
• Explanation of application of device discount
• Explanation of calculating the discount(s) and finding the new price
• Explanation of outputting new total
• Explanation of outputting amount saved
• Explanation of messages used

Question Answer Marks

2 2
True False
Statement
() ()

A structure diagram is a piece of code that is available throughout the structure of a program. 

A structure diagram shows the hierarchy of a system. 

A structure diagram is another name for an array. 

A structure diagram shows the relationship between different components of a system. 

Two marks for four correct rows.


One mark for three correct rows.

© UCLES 2020 Page 6 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

3(a) One mark for each correct validation check (max two) 4
• Range
• Length
• Type
• Check Digit

One mark for each correct related purpose (max two) e.g.
• To make sure the data entered falls within a specific set of values
• To make sure the data entered is no longer than specified
• To make sure the data entered follows rules related to whether it is numbers of letters
• To make sure an identification code entered is genuine or possible

3(b) One mark for correct verification check (max one) 1


• Double (data) entry
• Visual check

3(c) Any two correct statements (max two) e.g. 2


• Validation checks if the data entered is possible/it cannot check if data has been entered correctly.
• Verification checks if the data entered matches the data submitted for entry/ it does not check if data matches set
criteria.

Question Answer Marks

4(a) Any two correct statements (max two) e.g. 2


• The value of the variable Count begins as 0 …
• … and is incremented by 1 before it is tested by the loop condition
• Count will never be 0 at the end of the loop

© UCLES 2020 Page 7 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

4(b) 4
Count ← 0
REPEAT
INPUT Number
IF Number >= 100
THEN
Values[Count] ← Number
ENDIF
Count ← Count + 1
UNTIL Count = 50

One mark – separate INPUT statement


One mark – IF statement attempted
One mark – IF statement completely correct
One mark – termination of loop updated

4(c) Any two correct statements (max two) e.g. 2


• Alter the IFstatement/add a second IF statement/comparison that’s already there …
• … so that additional criteria set an upper limit of <=200

© UCLES 2020 Page 8 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

5(a) 4
Value Calc1 Calc2 OUTPUT

50 25 16

33 16 11

18 9 6 18

15 7 5

30 15 10 30

-1

One mark for each correct column (max four)

5(b) Any two correct statements e.g. 2


• The program outputs a value
• That is divisible by 6 // 2 and 3

© UCLES 2020 Page 9 of 10


0478/21 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

6(a) To uniquely identify a product (in TOOLS) 1

6(b) HS50 Hose (50 metres) 60 3


GFLG Garden Fork 50
LMPT Lawn Mower (Petrol) 25

One mark for correct data


One mark for correct format
One mark for data in correct order

6(c) 3
Field: Code Description Quantity_Stock

Table: TOOLS TOOLS TOOLS

Sort: Ascending

Show:     

Criteria: <25

or:

One mark for each completely correct column (max three)

© UCLES 2020 Page 10 of 10


Cambridge IGCSE™
* 2 0 3 5 3 9 2 7 0 5 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming May/June 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Blank pages are indicated.

DC (CJ/FC) 184928/3
© UCLES 2020 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material
A car park payment system allows customers to select the number of hours to leave their car in the
car park. The customer will get a discount if they enter their frequent parking number correctly. The
system calculates and displays the amount the customer must pay. The price of parking, the number
of hours the customer can enter, and any discount depend upon the day of the week and the arrival
time. The number of hours entered is a whole number. The price per hour is calculated using the
price in force at the arrival time. No parking is allowed between Midnight and 08:00.
Arrival time
Day of the week From 08:00 to 15:59 From 16:00 to Midnight
Max stay in hours Price per hour Hours Price
Sunday 8 2.00 Up to Midnight 2.00
Monday 2 10.00 Up to Midnight 2.00
Tuesday 2 10.00 Up to Midnight 2.00
Wednesday 2 10.00 Up to Midnight 2.00
Thursday 2 10.00 Up to Midnight 2.00
Friday 2 10.00 Up to Midnight 2.00
Saturday 4 3.00 Up to Midnight 2.00

A frequent parking number can be entered for discounted parking. This number consists of 4 digits
and a check digit that is calculated using a modulo 11 check digit calculation. A discount of 50% is
available for arrival times from 16:00 to Midnight; the discount is 10% at all other arrival times.
Write and test a program or programs to simulate the car park payment system.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Calculating the price to park.
A customer inputs the day, the hour of arrival excluding minutes (for example 15:45 would be 15),
the number of hours to leave their car, and a frequent parking number if available. If the frequent
parking number has an incorrect check digit, then no discount can be applied. The price to park,
based on the day, the hour of arrival, the number of hours of parking required and any discount
available, is calculated and displayed.
Task 2 – Keeping a total of the payments.
Extend Task 1 to keep a daily total of payments made for parking. The daily total is zeroed at the
start of the day. For the simulation, each customer inputs the amount paid, this must be greater than
or equal to the amount displayed. There is no change given so the amount input may exceed the
amount displayed. Each customer payment is added to the daily total, and this total is displayed at
the end of the day.
Task 3 – Making payments fairer.
Customers have complained that sometimes they are being charged too much if they arrive before
16:00 and depart after 16:00. Extend Task 1 to calculate the price before 16:00, then add the
evening charge. For example, a customer arriving at 14:45 on a Sunday and parking for five hours
was previously charged 10.00 and would now be charged 6.00

© UCLES 2020 0478/22/M/J/20


3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify two variables that you could have used for Task 1. Give the data type and state the
use of each variable.

Variable 1 ..................................................................................................................................

Data type ..................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................

Variable 2 ..................................................................................................................................

Data type ..................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................
[4]

(b) Data input by a customer for Task 1 includes the day and the hour of arrival.

Identify one suitable validation check for each input and justify your choice. Your validation
checks must be different.

Day of arrival – validation check ...............................................................................................

...................................................................................................................................................

Justification ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Hour of arrival – validation check .............................................................................................

...................................................................................................................................................

Justification ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2020 0478/22/M/J/20 [Turn over


4

(c) Explain how your program for Task 1 ensured that the frequent parking number entered by
the customer had a valid check digit.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(d) Write an algorithm for part of Task 2 that simulates customer payment and calculating total
payments using either pseudocode, programming statements or a flowchart. Assume that
Task 1 has been completed.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2020 0478/22/M/J/20
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2020 0478/22/M/J/20 [Turn over
6

(e) Explain how your program completed Task 3. Assume that Task 2 has been completed. Any
programming statements used in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2020 0478/22/M/J/20


7

Section B

2 Most programming languages include basic data types. Ahmad is describing the basic data types
he has used.

State the data type that Ahmad is describing in each sentence.

Choose the data type from this list of programming terms.

Array Boolean Char Constant Function Integer

Iteration Procedure Real String Variable

A number with a fractional part that can be positive or negative and used in calculations

Data type ..........................................................................................................................................

A whole number that can be positive, negative or zero and used in calculations

Data type ..........................................................................................................................................

A single number, symbol or letter

Data type ..........................................................................................................................................

A sequence of characters

Data type ..........................................................................................................................................

A data type with two values, True or False

Data type ..........................................................................................................................................


[5]

© UCLES 2020 0478/22/M/J/20 [Turn over


8

3 (a) An algorithm has been written in pseudocode to input the names and marks of 35 students.
The algorithm stores the names and marks in two arrays Name[ ] and Mark[ ]. The highest
mark awarded is found and the number of students with that mark is counted. Both of these
values are output.

01 HighestMark 100 ←
02 HighestMarkStudents 0 ←
03 FOR Count ←
1 TO 35
04 OUTPUT "Please enter student name"
05 INPUT Name[Count]
06 OUTPUT "Please enter student mark"
07 INPUT Mark[Counter]
08 IF Mark[Count] = HighestMark
09 THEN
10 HighestMarkStudents HighestMarkStudents – 1 ←
11 ENDIF
12 IF Mark[Count] > HighestMark
13 THEN
14 Mark[Count] HighestMark ←
15 HighestMarkStudents 1 ←
16 ENDIF
17 NEXT Count
18 OUTPUT "There are ", HighestMarkStudents," with the highest mark of ",
HighestMark

Give line numbers where the four errors are to be found in the pseudocode. Suggest a
correction for each error.

Error 1 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2020 0478/22/M/J/20


9

(b) Explain how you could extend the algorithm to also find the lowest mark awarded, count the
number of students with that mark, and output both these values.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]
© UCLES 2020 0478/22/M/J/20 [Turn over
10

4 This flowchart inputs the points won and the points lost when playing a game. The difference
between the points won and lost is calculated and depending on the result the player can: move
up to the next level, stay at the same level, or move down to the previous level. The flowchart
finishes when the input for points won is –1.

START

INPUT
PointsWon, PointsLost

IS
Yes END
PointsWon = –1 ?

No

Difference
PointsWon - PointsLost

OUTPUT IS
Yes
"Well done Difference > =
move up" 1000 ?

No

OUTPUT Yes IS
"Sorry move Difference < 0 ?
down"

No

OUTPUT
"Keep on trying"

© UCLES 2020 0478/22/M/J/20


11

(a) Complete a trace table for this set of input data:


5000, 4474, 6055, 2000, 7900, 9800, 3000, 2150, –1, 6700, 7615

PointsWon PointsLost Difference OUTPUT

[3]

(b) The flowchart needs to be changed. When the difference is more than 5000 the output
message is ‘Fantastic leap up two levels’.

Describe the changes that will need to be made to the flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2020 0478/22/M/J/20 [Turn over


12

5 Arrays are data structures used in programming. Explain what is meant by the terms dimension
and index in an array. Use examples of arrays in your explanations.

Dimension ........................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Index ................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[3]

© UCLES 2020 0478/22/M/J/20


13

6 A database table, JUICE, is used to keep a record of cartons of fresh fruit juice available for sale.

Juice code Fruit 1 Fruit 2 Size Volume (ml) Stock level


LMO10 Mango Orange Large 1000 18
MOO05 Orange Orange Medium 500 8
SAM02 Apple Mango Small 200 25
SAA02 Apple Apple Small 200 50
SPP02 Pineapple Pineapple Small 200 10
MMM05 Mango Mango Medium 500 12
LMM10 Mango Mango Large 1000 5
MGG05 Guava Guava Medium 500 5
SMO02 Mango Orange Small 200 7
MOP05 Orange Pineapple Medium 500 12
LAA10 Apple Apple Large 1000 32
SGO02 Guava Orange Small 200 10
LPP10 Pineapple Pineapple Large 1000 3
LOO10 Orange Orange Large 1000 25
SOO02 Orange Orange Small 200 40

(a) Identify a suitable field to use as the primary key. State a reason for your choice.

Field ..........................................................................................................................................

Reason ......................................................................................................................................

...................................................................................................................................................
[2]

(b) Complete the query-by-example grid to display only the stock level and size of all cartons
containing only apple juice.

Field:
Table:
Sort:
Show:
Criteria:
or:
[4]

© UCLES 2020 0478/22/M/J/20


14

BLANK PAGE

© UCLES 2020 0478/22/M/J/20


15

BLANK PAGE

© UCLES 2020 0478/22/M/J/20


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/22/M/J/20


Cambridge IGCSE™

COMPUTER SCIENCE 0478/22


Paper 2 May/June 2020
MARK SCHEME
Maximum Mark: 50

Published

Students did not sit exam papers in the June 2020 series due to the Covid-19 global pandemic.

This mark scheme is published to support teachers and students and should be read together with the
question paper. It shows the requirements of the exam. The answer column of the mark scheme shows the
proposed basis on which Examiners would award marks for this exam. Where appropriate, this column also
provides the most likely acceptable alternative responses expected from students. Examiners usually review
the mark scheme after they have seen student responses and update the mark scheme if appropriate. In the
June series, Examiners were unable to consider the acceptability of alternative responses, as there were no
student responses to consider.

Mark schemes should usually be read together with the Principal Examiner Report for Teachers. However,
because students did not sit exam papers, there is no Principal Examiner Report for Teachers for the June
2020 series.

Cambridge International will not enter into discussions about these mark schemes.

Cambridge International is publishing the mark schemes for the June 2020 series for most Cambridge
IGCSE™ and Cambridge International A & AS Level components, and some Cambridge O Level
components.

This document consists of 8 printed pages.

© UCLES 2020 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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 descriptors 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.

© UCLES 2020 Page 2 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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.

© UCLES 2020 Page 3 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Section A

Question Answer Marks

1(a) For two variables 4


One mark for identification of a variable with a suitable data type and one mark for its use

Variable hourArrived
Data type integer
Use to calculate the price based on the number of hours parking

Variable priceToPay
Data type real
Use store result of price calculation

Many correct answers, these are examples only.

1(b) For each validation check 4


One mark for identification of a check and one mark for the justification

Day
Check presence check
Justification need to enter day to be able to calculate price

Hour
Check range check
Justification need to check hour is between 8 and 23

Many correct answers, these are examples only.

© UCLES 2020 Page 4 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) Any four from: 4


• All 5 digits input
• Each of the first 4 digits is multiplied by a weight based on its position
• Specific method of individualising the digits described
• Added together divided by 11
• Remainder used to calculate correct 5th digit
• Checked against 5th digit input
• If the same, then valid

1(d) Any four from: 4


• Input amount
• Check amount greater than or equal to the price to pay …
• … True – add amount to daily total
• … False – ask for payment to be re-entered
• … Until valid amount input
Sample answer
PRINT "Please Enter Payment"
INPUT amount
WHILE amount < priceToPay DO
PRINT "Insufficient payment, please enter new Payment"
INPUT amount
ENDWHILE
totalPayment ← totalPayment + amount

1(e) Explanation 4
Any four from:
• Add number of hours selected to arrival hour
• Check if this is greater than 16
• True – calculate price up to 16 …
• … using current price in force
• … and add in evening charge
• False – calculate price as usual

Programming statements can be used but must be explained.

© UCLES 2020 Page 5 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Section B

Question Answer Marks

2 Real 5
Integer
Char/String
String
Boolean

Question Answer Marks

3(a) One mark for error and correction 4


Line 1 HighestMark ← 0
Line 7 INPUT Mark[Count]
Line 10 HighestMarkStudents ← HighestMarkStudents + 1
Line 14 HighestMark ← Mark[Count]

3(b) Any six from: 6


Add variable LowestMark …
… Set this to a high value for example 100
Add variable LowestMarkStudents …
… Set this to zero
Check if Mark[Count] = LowestMark …
… True – add 1 to LowestMarkStudents
Check if Mark[Count] < LowestMark …
… True – set LowestMarkStudenta to 1 and set LowestMark to Mark[Count]
Add extra output statement

© UCLES 2020 Page 6 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

4(a) One mark for correct input (PointsWon and PointsLost) 3


One mark for correct calculations (Difference)
One mark for correct output

PointsWon PointsLost Difference OUTPUT

5000 4474 526 Keep on trying

6055 2000 4055 Well done move up

7900 9800 -1900 Sorry move down

3000 2150 850 Keep on trying

-1 6700

4(b) Any three from: 3


• Add extra decision box …
• … before checking for difference greater than or equal to 1000
// change Is difference >= 1000 to >= 1000 and <= 5000
• Check for difference greater than 5000
• Add extra Output ‘Fantastic leap up two levels’…
• … before flowline returns to input

© UCLES 2020 Page 7 of 8


0478/22 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

5 One mark for explanation of dimension 3


One mark for explanation of index
One mark for inclusion of an example

The dimension is the number of indexes required to access an element.


The index is the position of the element in an array
For example A[25] is the 25th element of a one-dimensional array.

Question Answer Marks

6(a) One mark for field and one mark for reason 2
Field Juice code
Reason only unique identifier

6(b) 4
Field: Fruit 1 Fruit 2 Size Stock level

Table: JUICE JUICE JUICE JUICE

Sort:

Show:    

Criteria: ="Apple" ="Apple"

or:

One mark for each correct column

© UCLES 2020 Page 8 of 8


Cambridge IGCSE™
* 0 6 3 3 5 0 5 5 3 3 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming May/June 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages. Blank pages are indicated.

DC (CJ) 184934/3
© UCLES 2020 [Turn over
2

Section A
You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material
A school snack shop sells the following items:
Category Item code Description Price ($) Healthy?
Fruit FR1 Apple 1.00 Yes
Fruit FR2 Banana 1.25 Yes
Fruit FR3 Orange 1.00 Yes
Fruit FR4 Peach 1.30 Yes
Sandwich SN1 Cheese 1.75 Yes
Sandwich SN2 Cheese and Tomato 2.20 Yes
Sandwich SN3 Chicken 2.00 Yes
Sandwich SN4 Chicken Salad 2.35 Yes
Sandwich SN5 Salad (Vegetarian) 2.00 Yes
Crisps CR1 Salted 1.00 No
Crisps CR2 Cheese and Onion 1.00 No
Crisps CR3 Barbecue 1.00 No
Crisps CR4 Prawn Cocktail 1.00 No
Confectionery CN1 Biscuits 0.95 No
Confectionery CN2 Chocolate Bar 1.05 No
Confectionery CN3 Toffee and Chocolate Bar 1.25 No
Confectionery CN4 Chocolate Wafers 1.30 No
Drink DR1 Cola 1.20 No
Drink DR2 Lemon and Lime Soda 1.20 No
Drink DR3 Orange Soda 1.20 No
Drink DR4 Orange Juice 1.50 Yes
Drink DR5 Apple Juice 1.50 Yes
Write and test a program or programs for this snack shop.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All arrays, variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the system to show the items for sale and to allow items to be selected
Write a program to:
• use arrays to store the item code, description, price and whether or not the item is healthy
• allow a customer to choose an item to purchase
• output the description of each chosen item, its price and whether or not it is healthy
• allow the customer to choose additional items until they decide to stop
• calculate and output the total price of the chosen items.
Task 2 – Specifying quantities and introducing restrictions
Extend Task 1 to:
• allow the customer to input the quantity of each item they would like to purchase
• count the number of healthy and unhealthy items chosen by the customer. For example, two
apples and a peach count as three healthy items
• check that the customer has chosen at least one healthy item for every two unhealthy items.
If so, allow the customer to make the purchase. Otherwise, the purchase cannot proceed, a
message is output to say the purchase is cancelled and the customer has to start again.
Task 3 – Offering discounts
Extend the program to:
• either apply a 10% discount to the total price, when purchasing both healthy and unhealthy
items, only if the number of healthy items matches or exceeds the number of unhealthy items
• or apply a 20% discount to the total price if all the items purchased are healthy items
• calculate then output the new total price and the amount of money saved.

© UCLES 2020 0478/23/M/J/20


3

1 All variables, constants and other identifiers must have meaningful names.

(a) (i) Identify one array you could have used for Task 1 and state its purpose.

Array ..................................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(ii) Identify one variable you could have used for Task 2 and state its purpose.

Variable .............................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(iii) Identify one constant you could have used for Task 3 and state its purpose.

Constant ............................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(b) Explain why a student would be advised not to store the Healthy? data as a real data type
and identify the most suitable data type for the Healthy? data.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/23/M/J/20 [Turn over


4

(c) Write an algorithm for Task 1 using either pseudocode, programming statements or a
flowchart. It is not necessary to show initialisation or setting up of arrays.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2020 0478/23/M/J/20
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]
© UCLES 2020 0478/23/M/J/20 [Turn over
6

(d) Explain how your program completes Task 3. Assume Task 1 and Task 2 have been
completed. Any programming statements used in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2020 0478/23/M/J/20
7

(e) Describe how you could alter your program to restrict the maximum number of items
purchased by a customer to six.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/23/M/J/20 [Turn over


8

Section B

2 Draw a line to connect each Description to the most appropriate Pseudocode example.

Description Pseudocode example

A loop that will iterate


CASE … OF … OTHERWISE … ENDCASE
at least once

A loop that will not be


executed on the first test Number Number + 1
if the condition is false

A conditional statement WHILE … DO … ENDWHILE

Totalling Sum Sum + NewValue

Counting REPEAT … UNTIL

[4]

© UCLES 2020 0478/23/M/J/20


9

3 This section of pseudocode is to be used as a validation check that will continue until a number
between 0 and 499 inclusive is entered.

1 PRINT "Input a number from 0 to 499 inclusive"


2 FOR Number 1 TO 10
3 INPUT Number
4 IF Number < 0 AND Number > 499
5 THEN
6 PRINT "Invalid number, please try again"
7 ENDIF
8 UNTIL Number = 0 OR Number = 499
9 PRINT Number, " is within the correct range"

There are three lines in this pseudocode that contain errors. In each case, state the line number
to identify the incorrect line and write out the corrected line in full.

Error 1 line number ..........................................................................................................................

Correction .........................................................................................................................................

..........................................................................................................................................................

Error 2 line number ..........................................................................................................................

Correction .........................................................................................................................................

..........................................................................................................................................................

Error 3 line number ..........................................................................................................................

Correction .........................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2020 0478/23/M/J/20 [Turn over


10

4 A code must take the form LL9 9LL where L is a letter and 9 is a digit.

(a) A presence check has already been used to ensure data has been entered. Name two other
types of validation check that can be used to test the code is valid.

Check 1 .....................................................................................................................................

Check 2 .....................................................................................................................................
[2]

(b) Give one example of invalid test data for each of the validation checks you have named in
part (a) and in each case, give a reason why it fails the check. Each example of test data
must be different.

Check 1 Invalid Test Data .........................................................................................................

...................................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Check 2 Invalid Test Data .........................................................................................................

...................................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2020 0478/23/M/J/20


11

5 This algorithm finds prime numbers.

The pre-defined function DIV gives the value of the result of integer division,
for example, y 9 DIV 4 gives y a value of 2

Flag False
INPUT Number
WHILE Number <> 0
Divisor 2
WHILE Divisor <= Number / 2
Value Number DIV Divisor
IF Number / Divisor = Value
THEN
Flag True
ENDIF
Divisor Divisor + 1
ENDWHILE
IF Flag = False
THEN
OUTPUT Number, " is prime"
ENDIF
INPUT Number
Flag False
ENDWHILE

Complete the trace table for the algorithm using the input data:

5, 6, 8, 0, 11, 13

Flag Number Divisor Value OUTPUT

[5]

© UCLES 2020 0478/23/M/J/20 [Turn over


12

6 Draw the flowchart symbol for Decision and the flowchart symbol for Process.

Decision Process

[2]

7 A convenience store which sells general groceries wants to set up a database table called
STOCK. The table will contain fields including a description of the item, the price of the item
and the number in stock for each item. The STOCK table also has a fourth field to be used as a
primary key.

(a) Complete the table to suggest a suitable field name for each of the four fields in the table
STOCK. Give the purpose of the data to be stored in each field.

Field name Purpose of field contents

[4]

(b) Complete the query-by-example grid to output stock items where the quantity in stock has
fallen below 20. Only show the primary key and description of the items.

Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/23/M/J/20


Cambridge IGCSE™

COMPUTER SCIENCE 0478/23


Paper 2 May/June 2020
MARK SCHEME
Maximum Mark: 50

Published

Students did not sit exam papers in the June 2020 series due to the Covid-19 global pandemic.

This mark scheme is published to support teachers and students and should be read together with the
question paper. It shows the requirements of the exam. The answer column of the mark scheme shows the
proposed basis on which Examiners would award marks for this exam. Where appropriate, this column also
provides the most likely acceptable alternative responses expected from students. Examiners usually review
the mark scheme after they have seen student responses and update the mark scheme if appropriate. In the
June series, Examiners were unable to consider the acceptability of alternative responses, as there were no
student responses to consider.

Mark schemes should usually be read together with the Principal Examiner Report for Teachers. However,
because students did not sit exam papers, there is no Principal Examiner Report for Teachers for the June
2020 series.

Cambridge International will not enter into discussions about these mark schemes.

Cambridge International is publishing the mark schemes for the June 2020 series for most Cambridge
IGCSE™ and Cambridge International A & AS Level components, and some Cambridge O Level
components.

This document consists of 11 printed pages.

© UCLES 2020 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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 descriptors 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.

© UCLES 2020 Page 2 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
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.

© UCLES 2020 Page 3 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(a)(i) Any array related to Task 1 – one mark e.g. 2


ItemCode
Description

Correct purpose related to Task 1 - one mark e.g.


…to store the product code of the items in stock
…to store descriptions/names of the items on sale

1(a)(ii) Any variable related to Task 2 – one mark e.g. 2


Quantity
HealthyNum

Correct purpose related to Task 2 - one mark e.g.


… to allow input of the quantity of a product
… to store/track the number of healthy items in the order

1(a)(iii) Any constant related to Task 3 – one mark e.g. 2


Off10
Off20

Correct purpose related to Task 3 - one mark e.g.


… to store the ‘matching healthy items’ option discount rate
… to store the ’all healthy items’ discount rate

1(b) Any two correct statements e.g. 2


• The Healthy? data is not numerical
• Boolean

© UCLES 2020 Page 4 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) Any six from 6


• Input of item/item code (with message)
• Attempt at use of validation of input for item/item code
• Fully functional validation of input for item/item code
• Find location of item/item code in array
• Retrieve item description, price and whether it is healthy
• Check if another item is required – message and input
• Use of loop to repeat purchase option
• Running total of price
• Output of description of each item, price and healthy status (with message)
• Output total price with message (outside final loop)

Example answer
AnotherItem ← "Y"
While AnotherItem = "Y"
SnackCodeFlag ← False
OUTPUT "Input an Item Code"
WHILE SnackCodeFlag = False
INPUT SnackCode
Count ← 0
WHILE Count < 22 DO
IF SnackCode = ItemCode[Count]
THEN
SnackCodeFlag ← True
OUTPUT "Item Description ", Description[Count], " Item Price ",
Price[Count], " Item is Healthy? ", Healthy[Count]
TotalPrice ← TotalPrice + Price[Count]
Count ← 22
ENDIF
Count ← Count + 1
ENDWHILE
IF SnackCodeFlag = False
THEN

© UCLES 2020 Page 5 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

1(c) OUTPUT "Your Item Code doesn’t exist, please try again"
ENDIF
ENDWHILE
OUTPUT "Would you like another item? (Answer Y or N)"
INPUT AnotherItem
ENDWHILE
OUTPUT "The total price is ", TotalPrice

1(d) Any four from 4


• Explanation of comparing numbers of healthy and non-healthy items
• Explanation of checking for zero unhealthy items
• Explanation of applying the 10% discount rule
• Explanation of applying the 20% discount rule
• Explanation of calculating the new total price and money saved
• Explanation of output

1(e) One for each correct statement (max two) 2


• Use a loop structure when making purchases… / introduce a count of items when making purchases … /modify the
existing loop structure
• … that terminates after six iterations

© UCLES 2020 Page 6 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

2 Description Pseudocode example 4

A loop that will iterate at least once


CASE … OF … OTHERWISE … ENDCASE

A loop that will not be executed on the first


test if the condition is false Number ← Number + 1

A conditional statement
WHILE … DO … ENDWHILE

Totalling
Sum ← Sum + NewValue

Counting REPEAT … UNTIL

One mark – one correct link


Two marks – two correct links
Three marks – three correct links
Four marks – four/five correct links

© UCLES 2020 Page 7 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

3 Line 2 and Line 4 errors - One mark for each correct identification and correction of error 6

Error 1 line number: Line 2


Correction: REPEAT

Error 2 line number: Line 4


Correction: IF Number < 0 OR Number > 499

Line 8 error - One mark for correct identification of error and one mark for each correction of error
Error 2 line number: Line 8
Correction: UNTIL Number >= 0 AND Number <= 499

Question Answer Marks

4(a) One mark for each correct check (max two) 2


• Length (check)
• Type Check
• Format Check

4(b) One mark for each suitable piece of test data and one mark for each relevant reason (max four) 4
• LL9999LL999
• Too long

• 5678987
• All numeric

• CB12EU
• No space is present

© UCLES 2020 Page 8 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

5 5
Flag Number Divisor Value OUTPUT

False 5 2 2

5 is prime

False 6 2 3

True 3 2

True 4

False 8 2 4

True 3 2

True 4 2

False 0

One mark for each correct column

© UCLES 2020 Page 9 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

6 Decision Process 2

One mark for each correct symbol

Question Answer Marks

7(a) 4
Fieldname Purpose of field contents

CodeNo Primary key to identify products

Product To describe the product

Price The price of individual item

NumInStock How many are in stock

One mark for each correct fieldname and description pair

© UCLES 2020 Page 10 of 11


0478/23 Cambridge IGCSE – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

7(b) 3
Field: CodeNo Product NumInStock

Table: STOCK STOCK STOCK

Sort:

Show:    

Criteria: <20

or:

One mark for each completely correct column (max three)

© UCLES 2020 Page 11 of 11


Cambridge IGCSE™
* 5 2 7 8 6 0 5 5 8 3 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming October/November 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Blank pages are indicated.

DC (ST/CT) 185129/2
© UCLES 2020 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material

A car insurance system allows customers to check how much it would cost to buy insurance for a car for
twelve months. The starting price of the car insurance is $500. The actual price a customer pays for the car
insurance changes depending upon this information:
• engine size of car
• value of car
• where car is kept overnight
• number of kilometres (km) driven a year
• age of driver
• years insured without an insurance claim
Engine Kept 1000 km Years
Price Value in Price Price Price Age of Price Price
size in over- driven a without
change $1000 change change change driver change change
litres night year claim
<=0.5 –5% <0.5 –5% Garage –5% <5 –5% 18–20 +100% 1 –10%
>0.5 to 1.0 0% 0.5 to 2 0% Drive 0% 5 to 20 0% 21–25 +50% 2 –20%
>1.0 to 2.5 +5% >2 to 10 +5% Street +5% >20 +5% 26–30 +25% 3 –30%
>2.5 +10% >10 to 20 +10% 31–70 0% 4 –40%
>20 +15% 71–80 +10% 5 –50%
>80 +20% 6 –60%
>6 –70%
Table 1 Table 2
The actual price is calculated by:
• finding the total of the percentage changes for the customer using Table 1
• applying this total percentage change to the starting price of the car insurance
• applying the years without claim discount percentage for the customer using Table 2.
Write and test a program or programs to calculate the price for a customer to insure a car.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Calculate the price to insure a car.
Write a program to obtain the required information from a customer and calculate the price to insure the car.
Display the price to insure the car. Display the total percentage change calculated from Table 1, and the
years without claim discount percentage from Table 2 separately.
Task 2 – New customer discount.
Extend Task 1 to include an additional discount of 10% off the price to any new customer who is aged
between 26 and 70 inclusive, who also has 2 or more years without a claim. Display the amount of money
this would save and the new price.
Task 3 – Adding an extra driver.
Customers can add one extra driver. The age of the extra driver may increase the price. The new price is
calculated by applying the percentage price change for the age of the extra driver from Table 1 to the price.
Extend Task 2 to calculate and display the new price including an extra driver if required.

© UCLES 2020 0478/21/O/N/20


3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify one array that you could have used for Task 1. Give the data type and state the use
of the array.

Array .........................................................................................................................................

Data type ..................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[3]

(b) Data entered by a customer includes the age of the driver in Task 1.
Identify two different validation checks you could use for the age of the driver.
Justify your choice for each one.

Validation check 1 .....................................................................................................................

...................................................................................................................................................

Justification ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Validation check 2 .....................................................................................................................

...................................................................................................................................................

Justification ...............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2020 0478/21/O/N/20 [Turn over


4

(c) Write an algorithm for Task 2, using either pseudocode, programming statements or a
flowchart. Assume that Task 1 has been completed.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2020 0478/21/O/N/20


5

(d) (i) Explain how your program completed Task 3. Assume that Task 2 has been completed.
Any programming statements used in your answer must be fully explained.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

© UCLES 2020 0478/21/O/N/20 [Turn over


6

(ii) The car insurance system needs updating to record the percentage of customers who
bought car insurance after obtaining a price to insure a car. Describe the changes
required to your program.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2020 0478/21/O/N/20


7

Section B

2 Describe the purpose of variables and constants. Use an example of each in your answer.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [4]

© UCLES 2020 0478/21/O/N/20 [Turn over


8

3 This pseudocode algorithm calculates the weight and number of bags in a load of firewood. The
weight in kilograms of each bag is input. The algorithm finishes when either 50 bags have been
weighed, or as soon as the total weight exceeds 1000 kilograms. Only then are the total weight
and the number of bags in the load output.

01 TotalWeight ←
1000
02 BagCount 0 ←
03 MaxBag 50 ←
04 MaxWeight ←
1000
05 REPEAT
06 OUTPUT "Please Enter weight of bag"
07 INPUT Weight
08 TotalWeight ←
TotalWeight + Weight
09 BagCount ←
BagCount + 1
10 OUTPUT "Number of bags in the load is ", BagCount
11 UNTIL TotalWeight > MaxWeight AND BagCount >= MaxBag
12 OUTPUT "Total weight of the load is ", MaxWeight

(a) Give the line number(s) from the algorithm of:

an assignment statement .........................................................................................................

a loop ........................................................................................................................................

a counting statement ................................................................................................................

a totalling statement .................................................................................................................


[4]

(b) Give the line numbers of the four errors in this pseudocode. Suggest a correction for each
error.

Error 1 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]
© UCLES 2020 0478/21/O/N/20
9

(c) Explain how you could extend the algorithm to calculate and display the average weight of a
bag of firewood in the load.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2020 0478/21/O/N/20 [Turn over


10

4 This flowchart inputs five numbers and performs a calculation.

The predefined function MOD finds the remainder from integer division for example
R ← 25 MOD 11 gives R a value of 3

START

INPUT
V,W,X,Y,Z

IS Yes
V = 0? END

No

A ← V*2 + W*3 + X*4 + Y*5

B ← A MOD 11

Yes IS
OUTPUT
"Valid" B = Z?

No

OUTPUT
"Invalid"

© UCLES 2020 0478/21/O/N/20


11

(a) Complete the trace table for this set of input data:
5, 4, 6, 2, 1, 9, 3, 2, 1, 6, 7, 6, 1, 5, 1, 0, 0, 0, 0, 0

V W X Y Z A B OUTPUT

[4]

(b) Describe the purpose of this flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/21/O/N/20 [Turn over


12

5 A database table, AIRLINE, stores data used to compare airlines.

Number of Number of Head office Share price


Code Airline name
employees countries
FJ FastJet 60000 30 Europe 514.50
MA MurphyAir 35000 8 Europe 152.67
JS JetSeven 45000 22 Asia 257.44
K3 Koala3 22000 11 Australia 501.21
NS NorthState 30000 4 America 108.22
SS SouthState 30000 4 America 126.35
BJ BlueJet 15000 7 Africa 215.45
SK SkyKing 32000 27 Europe 506.12
PF PandaFly 50000 35 Asia 317.88

(a) State how many fields and how many records are shown in the AIRLINE table.

Number of Fields ......................................................................................................................

Number of Records ..................................................................................................................


[2]

(b) Show the output that would be given by this query-by-example.

Field: Airline name Number of employees Head office Share price


Table: AIRLINE AIRLINE AIRLINE AIRLINE
Sort:

Show: 3 3
Criteria: < 35000 > 500.00
or:

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/21/O/N/20


13

(c) Complete the query-by-example grid to find every airline with a head office in Asia or Africa,
and number of countries greater than 4. Only show the airline name and number of countries.

Field:

Table:
Sort:

Show:
Criteria:
or:

[4]

© UCLES 2020 0478/21/O/N/20


14

BLANK PAGE

© UCLES 2020 0478/21/O/N/20


15

BLANK PAGE

© UCLES 2020 0478/21/O/N/20


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/21/O/N/20


Cambridge IGCSE™

COMPUTER SCIENCE 0478/21


Paper 2 October/November 2020
MARK SCHEME
Maximum Mark: 50

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 2020 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 6 printed pages.

© UCLES 2020 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

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 descriptors
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.

© UCLES 2020 Page 2 of 6


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

Section A

1(a) For one array 3


One mark for naming of an array with a suitable data type and one mark for
its use

Array yearsWithoutClaim
Data type integer
Use to store the % discount

Many correct answers, this is an example only.

1(b) For each validation check 4


One mark for identification of a check and one mark for the reason max 4

Check presence check


Reason need to enter age to calculate price

Check type check


Reason need to check age is a positive integer

Many correct answers, these are examples only.

1(c) Any six from: 6


MP1 Input with prompt if new customer
MP2 Check age greater than or equal 26
MP3 Check age less than or equal 70
MP4 Check number of years without a claim greater than or equal to 2 …
MP5 … discount 10%
MP6 Otherwise discount 0%
MP7 Calculate new price and value of extra discount
MP8 Output new price and value of extra discount, with suitable message

Sample answer
PRINT "Are you a new customer Y/N?"
INPUT new
discount ← 0
IF new = "Y" DO
IF age >= 26 AND age <= 70
THEN
IF yearsWithoutClaim >=2
THEN
discount ← price * 0.1
price ← price * 0.9
ENDIF
ENDIF
PRINT "New price", price
PRINT "Extra discount for new customer", discount
ENDIF

© UCLES 2020 Page 3 of 6


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(d)(i) Explanation 4
Any four from:
MP1 Provide a prompt and input to check if additional driver required
MP2 Check response with IF/REPEAT/WHILE/CASE statement for yes
MP3 … input age of additional driver
MP4 … Use of IF / REPEAT etc. to validate age
MP5 … use the age input to find / look up appropriate price increase
MP6 … description of how the price to pay now is calculated
MP7 … description of how the price to pay now is displayed including the use
of a suitable message
For no
MP8 … no output required or suitable message output

Programming statements can be used but must be explained.

1(d)(ii) Description 3
Any three from:
MP1 Use a variable (quotes) to keep a running total of the number of quotes
provided
MP2 Ask, using prompt with input, customers if they are going to purchase
the insurance
MP3 Use another variable (policies) to keep a running total of the number of
insurances bought / not bought
MP4 Use these to calculate the percentage policies/quotes*100

Question Answer Marks

Section B

2 One mark for description of variable 4


One mark for description of constant
One mark for inclusion of an example variable
One mark for inclusion of an example constant

Example answer:
A value that can change during the execution of a program
A named value that cannot change during the execution of a program
Variable example - using a counter for example counter ← counter + 1
Constant example – a static value that can be used for checking for example
< maxAge

Question Answer Marks

3(a) Line 1/2/3/4/8/9 4


Lines 5–11
Line 9
Line 8

© UCLES 2020 Page 4 of 6


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

3(b) One mark for error and correction 4


Line 1 TotalWeight ← 0
Line 10 move OUTPUT "Number of bags in the load is ",
BagCount to end / after line 11
Line 11 UNTIL TotalWeight > MaxWeight OR BagCount >= MaxBag
Line 12 OUTPUT "Total weight of the load is ", TotalWeight

3(c) Any four from: 4


After line 11
Divide TotalWeight by
… BagCount
Assign a new variable AverageWeight ← TotalWeight / BagCount
Output the result OUTPUT AverageWeight
With a message "Average weight of a bag of firewood is "

Question Answer Marks

4(a) One mark for correct input columns (V, W, X, Y, Z) 4


One mark for correct calculation column A
One mark for correct calculation column B
One mark for correct output column

V W X Y Z A B OUTPUT

5 4 6 2 1 56 1 Valid

9 3 2 1 6 40 7 Invalid

7 6 1 5 1 61 6 Invalid

0 0 0 0 0

4(b) • (Use first four digits input to) calculate a check digit 2
• Check if the check digit input is valid

Question Answer Marks

5(a) 6 fields 2
9 records

5(b) Either mark by row or by column but not both 2


One each correct row or one mark for each correct column max two
Koala3 Australia
SkyKing Europe

© UCLES 2020 Page 5 of 6


0478/21 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

5(c) 4
Field: Airline name Number of Head office
countries

Table: AIRLINE AIRLINE AIRLINE

Sort:

Show:    

Criteria: >4 ="Asia"

or: >4 ="Africa"

one mark for correct fields and correct table names, must have the three
columns required, ignore another column provided the show row is not ticked
and there are no criteria set for that column
one mark for correct show row
one mark for correct number of countries criteria
one mark for correct head office criteria

© UCLES 2020 Page 6 of 6


Cambridge IGCSE™
* 1 1 2 9 1 3 8 4 5 2 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming October/November 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages. Blank pages are indicated.

DC (ST) 185711/3
© UCLES 2020 [Turn over
2

Section A
You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material

An online computer shop sells customised personal computers. Every computer sold includes a basic set of
components costing $200 and additional items can be added from the table:
Category Item code Description Price ($)
Case A1 Compact 75.00
Case A2 Tower 150.00
RAM B1 8 GB 79.99
RAM B2 16 GB 149.99
RAM B3 32 GB 299.99
Main Hard Disk Drive C1 1 TB HDD 49.99
Main Hard Disk Drive C2 2 TB HDD 89.99
Main Hard Disk Drive C3 4 TB HDD 129.99
Solid State Drive D1 240 GB SSD 59.99
Solid State Drive D2 480 GB SSD 119.99
Second Hard Disk Drive E1 1 TB HDD 49.99
Second Hard Disk Drive E2 2 TB HDD 89.99
Second Hard Disk Drive E3 4 TB HDD 129.99
Optical Drive F1 DVD/Blu-Ray Player 50.00
Optical Drive F2 DVD/Blu-Ray Re-writer 100.00
Operating System G1 Standard Version 100.00
Operating System G2 Professional Version 175.00
As well as the basic set of components every computer must include one case, one RAM and one Main Hard
Disk Drive from the table.
A computer is supplied with or without an Operating System.
Write and test a program or programs for the online computer shop.
• Your program or programs must include appropriate prompts for the entry of data; data must be validated
on entry.
• Error messages and other output need to be set out clearly and understandably.
• All arrays, variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the system and ordering the main items.
Write a program to:
• use arrays to store the item code, description and price
• allow a customer to choose one case, one RAM and one Main Hard Disk Drive
• calculate the price of the computer using the cost of the chosen items and the basic set of components
• store and output the chosen items and the price of the computer.
Task 2 – Ordering additional items.
Extend TASK 1 to:
• allow a customer to choose whether to purchase any items from the other categories – if so, which
item(s)
• update the price of the computer
• store and output the additional items and the new price of the computer.
Task 3 – Offering discounts.
Extend TASK 2 to:
• apply a 5% discount to the price of the computer if the customer has bought only one additional item
• apply a 10% discount to the price of the computer if the customer has bought two or more additional
items
• output the amount of money saved and the new price of the computer after the discount.
© UCLES 2020 0478/22/O/N/20
3

1 All variables, constants and other identifiers must have meaningful names.

(a) (i) Identify one array you could have used for Task 1 and state its purpose.

Array ..................................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(ii) Identify one variable you could have used for Task 2 and state its purpose.

Variable .............................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(iii) Identify one constant you could have used for Task 3 and state its purpose.

Constant ............................................................................................................................

Purpose .............................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(b) Explain the benefits of storing Price as a real data type.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/22/O/N/20 [Turn over


4

(c) Write an algorithm to show how you completed Task 1, using either pseudocode,
programming statements or a flowchart. It is not necessary to show initialisation or setting up
of arrays in your answer.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2020 0478/22/O/N/20
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2020 0478/22/O/N/20 [Turn over


6

(d) Explain how your program completes Task 3. Any programming statements used in your
answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2020 0478/22/O/N/20
7

(e) Describe how you could alter your program to allow more than one computer to be bought.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/22/O/N/20 [Turn over


8

Section B

2 Tick (3) one box in each row to identify if the statement about subroutines is true or false.

true false
Statement
(3) (3)
A subroutine is called from within a program.

A subroutine is not a complete program.

A subroutine is a self-contained piece of code.

A subroutine must return a value to the code from which it was called.
[2]

3 This pseudocode algorithm is used as a validation check.

PRINT "Input a number from 1 to 5000"


REPEAT
INPUT Number
IF Number < 1 OR Number > 5000
THEN
PRINT "Invalid number, please try again"
ENDIF
UNTIL Number >= 1 AND Number <= 5000
PRINT Number, " is within the correct range"

Identify three different types of test data. For each type, give an example of the test data you
would use to test this algorithm and state a reason for your choice of test.

Type of test data 1 ...........................................................................................................................

Test data ...........................................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

Type of test data 2 ...........................................................................................................................

Test data ...........................................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

Type of test data 3 ...........................................................................................................................

Test data ...........................................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2020 0478/22/O/N/20


9

4 This pseudocode algorithm allows 5000 numbers to be entered and stored in an array called
Number.

FOR Count 1 TO 5000


INPUT Number[Count]
NEXT Count

Extend and re-write the algorithm using pseudocode to also count and output how many of the
numbers stored in the array are greater than 500, using the variable Higher. Only output Higher
once with an appropriate message.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

.................................................................................................................................................... [6]
© UCLES 2020 0478/22/O/N/20 [Turn over
10

5 This pseudocode represents an algorithm.

REPEAT
Flag 0
FOR Count 0 to 3
IF Num[Count] < Num[Count + 1]
THEN
Store Num[Count]
Num[Count] Num[Count + 1]
Num[Count + 1] Store
Flag 1
ENDIF
NEXT Count
UNTIL Flag = 0

(a) The contents of the array at the start of the algorithm are:

Num[0] Num[1] Num[2] Num[3] Num[4]


45 56 30 12 15

Complete the trace table for the algorithm using the data given in the array.

Flag Count Num[0] Num[1] Num[2] Num[3] Num[4] Store


45 56 30 12 15

[5]

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]
© UCLES 2020 0478/22/O/N/20
11

6 Draw a flowchart symbol to represent each of the following:

Input/Output Decision

[2]

Question 7 starts on Page 12.

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/22/O/N/20 [Turn over


12

7 The table AUDIOPARTS stores the part number, description, cost and quantity in stock of the
items sold by a music shop.

PartNum Description Cost Quantity


A01 Compact Amplifier Case 50.00 15
A02 Deluxe Amplifier Case 75.00 1
A03 Amplifier Standard 79.99 48
A04 Amplifier Midrange 149.99 50
A05 Amplifier Megablaster 299.99 48
S01 Tweeter 59.99 10
S02 Midrange Woofer 99.99 0
S03 Subwoofer 139.99 16
S04 Tower Speaker Basic 159.99 25
S05 Tower Speaker Skyscraper 219.99 9
S06 Centre Speaker 149.99 25
S07 Soundbar 89.99 2
S20 Soundbar 129.99 0
S21 Ceiling Surround Speaker 75.00 15
S22 Ceiling Full Range Speaker 100.00 1
S25 Surround Speaker 100.00 60
T19 Speaker Stands (Pair) 75.00 60

(a) State the number of records in the table AUDIOPARTS

............................................................................................................................................. [1]

(b) Identify the field that is most suitable to be a primary key and give a reason for your choice.

Fieldname .................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[2]

(c) Complete the query-by-example grid to show the items where the quantity in stock is fewer
than 10. Show all the fields from the database table in descending order of cost.

Field:

Table:

Sort:

Show:
Criteria:

or:

[4]
© UCLES 2020 0478/22/O/N/20
Cambridge IGCSE™

COMPUTER SCIENCE 0478/22


Paper 2 October/November 2020
MARK SCHEME
Maximum Mark: 50

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 2020 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 9 printed pages.

© UCLES 2020 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

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 descriptors
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.

© UCLES 2020 Page 2 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(a)(i) Any meaningful name for an array related to Task 1 – one mark e.g. 2
SysStore
SysPrice

Correct purpose related to Task 1 – one mark e.g.


…to store the system (components) that have been purchased
…to store the (total) price of the system (being purchased)

1(a)(ii) Any meaningful name for a variable related to Task 2 – one mark e.g. 2
Component
TotalPrice

Correct purpose related to Task 2 - one mark e.g.


… to allow input of a component code
… to store/calculate the running total price of the system

1(a)(iii) Any meaningful name for a constant related to Task 3 – one mark e.g. 2
Offer5
Offer10

Correct purpose related to Task 3 - one mark e.g.


… to store the one option discount rate
… to store the two-option discount rate

1(b) Mark as either: 2


Two distinct different points
OR
One point and an expansion

Example answers:
Real data can be used in calculations directly (which is required of the Price
data) (1)
Data can be stored with decimal places (1)

Real numbers can be used in calculations (1) which is not possible with strings
(1)

© UCLES 2020 Page 3 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(c) Any six from: 6


MP1 At least one input (case, RAM, HDD)
MP2 All three inputs fully prompted
MP3 An attempt at validation of input
MP4 One complete validation of input with error message
MP5 Finding the price for one chosen item
MP6 Finding the prices of the other two chosen items correctly
MP7 Calculation of price of the chosen items
MP8 …add the basic components cost to the cost of the chosen items
MP9 Storage of chosen items
MP10 Output to show chosen items and price of the computer (with
appropriate message)

Example answer:
OUTPUT "Which type of Case would you like? Input the Item
Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT CaseCode
Count ← 0
WHILE Count<2 DO
IF CaseCode = ComponentCode[Count]
THEN
CaseIndex ← Count
ComponentFlag ← True
Count ← 2
ENDIF
Count ← Count + 1
ENDWHILE
IF ComponentFlag = False
THEN
OUTPUT "Your case Item Code doesn’t exist, please
try again"
ENDIF
ENDWHILE
OUTPUT "Which type of RAM would you like? Input the Item
Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT RAMCode
Count ← 2
WHILE Count<5 DO
IF RAMCode = ComponentCode[Count]
THEN
RAMIndex ← Count
ComponentFlag ← True
Count ← 5
ENDIF
Count ← Count + 1
ENDWHILE

© UCLES 2020 Page 4 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(c) IF ComponentFlag = False


THEN
OUTPUT "Your RAM Item Code doesn’t exist, please try
again"
ENDIF
ENDWHILE
OUTPUT "Which type of Primary Hard Disk Drive would you
like? Input the Item Code"
ComponentFlag ← False
WHILE ComponentFlag = False
INPUT PHDDCode
Count ← 5
WHILE Count<8 DO
IF PHDDCode = ComponentCode[Count]
THEN
HDDIndex ← Count
ComponentFlag ← True
Count ← 8
ENDIF
Count ← Count + 1
ENDWHILE
IF ComponentFlag = False
THEN
OUTPUT "Your Primary HDD Item Code doesn’t exist,
please try again"
ENDIF
ENDWHILE
TotalPrice ← 200 + ComponentPrice[CaseIndex] +
ComponentPrice[RAMIndex] + ComponentPrice[HDDIndex]
OUTPUT "Your computer consists of ",
Description[CaseIndex], " case, ", Description[RAMIndex],
" RAM and ", Description[HDDIndex], " Primary Hard Disk
Drive."
OUTPUT "The total price of your computer is $", TotalPrice

1(d) Any four from: 4


MP1 Explanation of how the number of additional parts is stored
MP2 Explanation of counting of additional parts being added to the system
MP3 Explanation of determination of additional parts being 1, or more
than 1
MP4 Explanation of using the correct percentage discount
MP5 Explanation of calculating the money saved and finding the new price
MP6 Explanation of correct output of money saved and new price

1(e) Any two from: 2


MP1 Prompt and input to ask buyer how many computers they wish to
purchase (at the start) // When the first computer is complete, prompt
and input to ask if they would like to purchase another computer
MP2 Introduce an appropriate loop structure
MP3 New storage for more than one computer // Enable the ordering of
multiple computers of the same specification

© UCLES 2020 Page 5 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

Section B

2 2
true false
Statement
() ()

A subroutine is called from within a program. 

A subroutine is not a complete program. 

A subroutine is a self-contained piece of code. 

A subroutine must return a value to the code from 


which it was called.

Two marks for four correct rows


One mark for any two correct rows

Question Answer Marks

3 One mark for each correct type of test and one mark for each correct 6
accompanying example of test data and reason (max six) e.g.

• Extreme data
• 5000
• to check it is accepted

• Normal data
• 300
• To check it is accepted

• Abnormal data
• 10000
• To check it is rejected

© UCLES 2020 Page 6 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

4 Any six from: 6


MP1 Initialisation of Higher to 0 before the loop
MP2 Use of IF statement
MP3 Correct condition in IF statement
MP4 Correct counting statement inside loop
MP5 OUTPUT/PRINT statement with correct reference to Higher
MP6 Appropriate message in output
MP7 Correct location of OUTPUT and IF statements

Higher ← 0
FOR Count ← 1 TO 5000
INPUT Number[Count]
IF Number[Count] > 500
THEN
Higher ← Higher + 1
ENDIF
NEXT Count
OUTPUT "There are ", Higher, " values that are greater than
500"

© UCLES 2020 Page 7 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

5(a) 5
Num Num Num Num Num
Flag Count Store
[0] [1] [2] [3] [4]

45 56 30 12 15

0 0 45

56

1 45

3 12

15

12

0 0

One mark – Flag column


One mark – Count column
One mark – Num[0] and Num[1] columns
One mark – Num[2], Num[3] and Num[4] columns
One mark – Store column

5(b) Any two from: 2


• The algorithm sorts/orders numbers
• … into descending order / from largest to smallest

Question Answer Marks

6 Input/Output Decision 2

One mark for each correct symbol

© UCLES 2020 Page 8 of 9


0478/22 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

7(a) 17 1

7(b) One mark for correct fieldname and one mark for correct reason 2

PartNum

The data stored in this field is unique for each record

7(c) 4
Field: PartNum Description Cost Quantity

Table: AUDIOPARTS AUDIOPARTS AUDIOPARTS AUDIOPARTS

Sort: Descending

Show:    

Criteria: <10

or:

One mark for correct field and table rows


One mark for sort row
One mark for show row
One mark for correct criteria

© UCLES 2020 Page 9 of 9


Cambridge IGCSE™
* 0 4 0 5 0 8 6 6 6 5 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming October/November 2020

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Blank pages are indicated.

DC (ST/JG) 185347/3
© UCLES 2020 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material

A baguette ordering service allows customers to order filled baguettes. There are two sizes of
baguette: 30 cm and 15 cm. Baguettes are available as white, brown or seeded bread. Baguettes
have one filling and can have up to three salad items added.
Filling and salad choices are:

Filling Salad
Beef Lettuce
Chicken Tomato
Cheese Sweetcorn
Egg Cucumber
Tuna Peppers
Turkey

Customers choose their baguette options. They then confirm their order, alter their choices or choose
not to proceed.
Each day the ordering service calculates the number of each:
• size of baguette sold
• type of bread (white, brown or seeded) sold
• filling sold.
Write and test a program or programs for the baguette ordering service.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Ordering.
Customers are given choices on size, type of bread, filling and salad items as shown. Only valid
choices can be accepted. The customer is asked to confirm their order, alter their choices or choose
not to proceed. If the customer confirms their order they are given a unique order number. Display
the baguette ordered and the order number.

Task 2 – Recording the choices.


Extend TASK 1 to record totals for the size, types of bread and fillings sold that day and calculate
the total number of baguettes sold that day.

Task 3 – Finding the most and least popular baguette fillings.


Using your results from TASK 2, display the most popular and least popular fillings as a percentage
of the total number of baguettes sold that day.

© UCLES 2020 0478/23/O/N/20


3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify one constant and identify one variable that you could have used for Task 1. Give the
value that would be assigned to the constant. Give the data type for the variable. State what
each one could be used for.

Constant ...................................................................................................................................

Value .........................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................

Variable .....................................................................................................................................

Data type ..................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................
[6]

(b) (i) Write an algorithm to allow a customer to choose the filling and salad items for their
baguette (part of Task 1), using either pseudocode, programming statements or a
flowchart. Your algorithm must only include this part of Task 1.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
© UCLES 2020 0478/23/O/N/20 [Turn over
4

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
© UCLES 2020 0478/23/O/N/20
5

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [5]

(ii) Explain how your algorithm in part (b)(i) ensured that only valid choices were accepted
for the filling.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

(c) Explain how you would need to change your program for Task 1 if there were three sizes of
baguette to choose from (15 cm, 20 cm and 30 cm).

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/23/O/N/20 [Turn over


6

(d) Explain how your program completed Task 3. Assume that Task 2 has been completed.
Any programming statements used in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2020 0478/23/O/N/20


7

Section B starts on Page 8.

© UCLES 2020 0478/23/O/N/20 [Turn over


8

Section B

2 An algorithm has been written in pseudocode to check the temperature readings taken from a
freezer are within the range –18 degrees to –25 degrees inclusive.

The algorithm counts the number of times that the temperature reading is below –25 degrees and
the number of times that the temperature reading is above –18 degrees.

An engineer is called if there are more than 10 temperature readings below –25 degrees.

An alarm sounds if there are more than 5 temperature readings above –18 degrees.

01 TooHot 0
02 TooCold 1000
03 REPEAT
04 OUTPUT "Please enter temperature"
05 INPUT Temperature
06 IF Temperature < -25
07 THEN
08 TooCold TooCold – 1
09 ENDIF
10 IF Temperature > -18
11 THEN
12 TooHot TooHot + 1
13 ENDIF
14 UNTIL TooHot > 5 OR TooCold > 10
15 IF TooHot < 5
16 THEN
17 INPUT "Alarm!!"
18 ENDIF
19 IF TooCold > 10
20 THEN
21 OUTPUT "Call the Engineer"
22 ENDIF

(a) Give the line number(s) from the algorithm of:

an assignment statement .........................................................................................................

a loop ........................................................................................................................................

a counting statement ................................................................................................................

a selection statement ................................................................................................................


[4]

© UCLES 2020 0478/23/O/N/20


9

(b) Give line numbers where the four errors are to be found in the pseudocode. Suggest a
correction for each error.

Error 1 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 line number ...................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

(c) Explain how you could extend the algorithm to count the number of times the temperature
readings are within the range –18 degrees to –25 degrees inclusive.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2020 0478/23/O/N/20 [Turn over


10

3 Four programming concepts and five descriptions are shown.

Draw a line to connect each Programming concept to its correct Description. Not all Descriptions
will be connected to a Programming concept.

Programming concept Description

A subroutine that does not have to


Validation
return a value

An automatic check to ensure that data


input is reasonable and sensible
Verification

A subroutine that always returns


a value

Procedure
An overview of a program or subroutine

A check to ensure that data input


Function
matches the original
[4]

© UCLES 2020 0478/23/O/N/20


11

Question 4 starts on Page 12.

© UCLES 2020 0478/23/O/N/20 [Turn over


12

4 This flowchart represents an algorithm that allows the input of two numbers and performs a
calculation.

The predefined function MOD finds the remainder from integer division for example X 8 MOD 5
gives X a value of 3.

START

INPUT
Y,Z

IS Yes
Y = 0? END

No

IS Yes
Y > Z? A Y MOD Z

No

A Z MOD Y

OUTPUT Yes IS
"Valid" A = 0?

No

OUTPUT
"Invalid"

© UCLES 2020 0478/23/O/N/20


13

(a) Complete a trace table for this set of input data:


11, 4, 6, 2, 3, 9, 3, 2, 2, 6, 0, 0, 1, 1

Y Z A OUTPUT

[4]

(b) Explain the purpose of this algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/23/O/N/20 [Turn over


14

5 A marine wildlife rescue centre uses a database table, MARINE, to keep records of its creatures.

Creature Class Quantity Ready for release Offspring


Manta Ray Fish 3 Y N
Short-tailed Albatross Bird 4 Y N
Emperor Penguin Bird 50 Y Y
Bluefin Tuna Fish 2 N N
Manatee Mammal 4 Y N
Hawksbill Turtle Reptile 10 Y Y
Hammerhead Shark Fish 3 Y N
Yellow-eyed Penguin Bird 4 Y N
Kemp’s Ridley Sea Turtle Reptile 1 Y N

(a) State how many fields and how many records are shown in this table.

Number of fields .......................................................................................................................

Number of records ....................................................................................................................


[2]

(b) Show the output that would be given by this query-by-example.

Field: Creature Class Ready for release

Table: MARINE MARINE MARINE

Sort:

Show: 3 3
Criteria: ="Bird"

or:

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2020 0478/23/O/N/20


15

(c) Complete the query-by-example grid to display the creatures, in ascending order of quantity,
that have no offspring and are ready for release. Display only the creature field.

Field:

Table:

Sort:

Show:
Criteria:

or:

[4]

© UCLES 2020 0478/23/O/N/20


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2020 0478/23/O/N/20


Cambridge IGCSE™

COMPUTER SCIENCE 0478/23


Paper 2 October/November 2020
MARK SCHEME
Maximum Mark: 50

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 2020 series for most
Cambridge IGCSE™, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 7 printed pages.

© UCLES 2020 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

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 descriptors
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.

© UCLES 2020 Page 2 of 7


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

Section A

1(a) Constant name MaxSalad 6


Value 3
Use Storing the salad items a baguette can have

Variable name OrderNumber


Data type integer
Use storing the next order number available

Many correct answers, this is an example only.

© UCLES 2020 Page 3 of 7


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(b)(i) Any five from: 5


MP1 Display fillings available
MP2 Prompt and entry of filling choice
MP3 Only accept one correct filling
MP4 Prompt and entry of number of salads
MP5 Only accept 0 to 3 inclusive
MP6 Display salads available
MP7 Prompt and entry of correct number of salad choices
MP8 Only accept correct salad choices
MP9 At least one error message for incorrect data entry

Example answer:
REPEAT
PRINT "Beef 1"
PRINT "Chicken 2"
PRINT "Cheese 3"
PRINT "Egg 4"
PRINT "Tuna 5"
PRINT "Turkey 6"
OUTPUT "Please enter your choice of filling"
INPUT Filling
UNTIL Filling >=1 AND Filling <=6
PRINT "Lettuce 1"
PRINT "Tomato 2"
PRINT "Sweetcorn 3"
PRINT "Cucumber 4"
PRINT "Peppers 5"
REPEAT
PRINT "How many salads do you want"
INPUT NumSalad
UNTIL NumSalad >= 0 and NumSalad <=3
WHILE NumSalad >0 DO
PRINT "Enter Salad ", NumSalad
OUTPUT "Please enter your choice of salad"
INPUT SaladType
CASE SaladType OF
1: NumSalad  NumSalad – 1
2: NumSalad  NumSalad – 1
3: NumSalad  NumSalad – 1
4: NumSalad  NumSalad – 1
5: NumSalad  NumSalad – 1
OTHERWISE: PRINT "Error"
ENDCASE
Salad[NumSalad]  SaladType

ENDWHILE

1(b)(ii) Any three from: 3


MP1 Provide a method of inputting the filling selection
MP2 Check input is a correct filling e.g. using a CASE statement
MP3 If not output a suitable error message
MP4 If not provide a suitable method to re-input e.g. use of REPEAT…UNTIL

© UCLES 2020 Page 4 of 7


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

1(c) Any two from: 2


MP1 Store three sizes of baguette e.g. add third baguette size to array
MP2 Change the prompt to output three sizes of baguettes
MP3 Change the selection statement to allow for a third size of baguette e.g.
IF/REPEAT/WHILE…

1(d) Explanation 4
Any four from:
MP1 check the total for each of the baguette fillings e.g. use of FOR loop
MP2 use of two variables one for most popular filling and one for least
popular filling
MP3 method used to select the largest value as the most popular e.g. use of
IF statement
MP4 method used to select the smallest value as the least popular e.g. use of
IF statement
MP5 Use these values to calculate percentages
MP6 … with the total number of baguettes sold
MP7 Display results including suitable messages e.g. use of PRINT
statement …

Programming statements can be used but must be explained.

Question Answer Marks

Section B

2(a) Line 1/2/8/12 4


Line 3 and/or 14
Line 8/12
Line 6/10/15/19

2(b) One mark for error and correction 4


Line 02 TooCold ← 0
Line 08 TooCold ← TooCold + 1
Line 15 IF TooHot > 5
Line 17 OUTPUT "Alarm!!"

2(c) Any four from: 4


Add a new variable inRange …
… set to zero at start of algorithm
Add extra IF statement
IF temperature >= -25 AND temperature <= -18
Update inRange by 1 if true

© UCLES 2020 Page 5 of 7


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

3 One mark for each correct line 4

Question Answer Marks

4(a) One mark for each correct column 4

Y Z A OUTPUT

11 4 3 Invalid

6 2 0 Valid

3 9 0 Valid

3 2 1 Invalid

2 6 0 Valid

0 0

4(b) Any two from: 2


Checking if the remainder, when the larger number is divided by the smaller
number, is zero
To see if the larger number is a multiple of the smaller number
To see if the smaller number is a factor of the larger number

© UCLES 2020 Page 6 of 7


0478/23 Cambridge IGCSE – Mark Scheme October/November
PUBLISHED 2020

Question Answer Marks

5(a) 5 fields 2
9 records

5(b) One mark for each correct column max two, 2


Or two correct rows one mark
Short-tailed Albatross Y
Emperor Penguin Y
Yellow-eyed Penguin Y

5(c) 4
Field: Creature Quantity Offspring Ready for
release

Table: MARINE MARINE MARINE MARINE

Sort: Ascending

Show:    

Criteria: =N =Y

or:

One mark for each correct field and table rows


One mark for sort row
One mark for show row
One mark for correct criteria

© UCLES 2020 Page 7 of 7


Cambridge IGCSE™
* 8 1 2 9 3 2 0 6 3 8 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming May/June 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Any blank pages are indicated.

DC (CJ/AR) 202720/2
© UCLES 2021 [Turn over
2

Section A
You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release Material

A system is required to record and count votes for candidates in school council elections. The voting
system will allow for one representative to be elected from a tutor group. The school has between
28 and 35 students in each tutor group, five year groups named Year 7 to Year 11, and there are six
tutor groups in each year group. Tutor group names are their year group followed by a single letter
e.g. 7A, 7B, etc.
All students are allowed to vote in the system. Each student may only vote once for a representative
from their tutor group in the election.
Write and test a program or programs for the voting system.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the voting system to allow a tutor group to elect a representative.
Write a program to:
• allow the tutor to enter the name of the tutor group
• allow the tutor to enter the number of students in the tutor group
• allow the tutor to enter the number of candidates in the election; maximum of four candidates
• allow the tutor to enter the names of the candidates and store them in a suitable data structure
• allow each student to input their vote or to abstain
• count the votes for each candidate and student abstentions.
When all students have voted, display the name of the tutor group, the votes for each candidate
and the name of the candidate who has won the election. If there is a tie for first place, display all
candidates with the equal highest number of votes.
Task 2 – Checking that students only vote once.
Each student is given a unique voter number by their teacher.
Extend Task 1 to achieve the following:
• Allow students to enter their unique voter number before casting their vote.
• Check whether the student has already voted:
– if so, supply a suitable message and do not allow them to vote.
– if not, store the unique voter number, but not their vote, in a suitable data structure, and
add their vote to the relevant candidate count or abstention.
Task 3 – Showing statistics and dealing with a tie.
Extend Task 2 to achieve the following:
• Calculate the percentage of the votes that each candidate received from the number of votes
cast, excluding abstentions.
• Display the name of each candidate, the number of votes and the percentage of votes they
received from the number of votes cast, excluding abstentions.
• Display the total number of votes cast in the election and the number of abstentions.
• In the event of a tie, allow the election to be immediately run again, with only the tied candidates
as candidates, and all the students from the tutor group voting again.
© UCLES 2021 0478/21/M/J/21
3

1 (a) All variables, constants and other identifiers must have meaningful names.

(i) Identify one constant you could have used for Task 1, give the value that would be
assigned to it and its use.

Constant ............................................................................................................................

Value .................................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[3]

(ii) Identify one variable and one array you could have used for Task 1.
Explain the use of each one.

Variable .............................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

Array ..................................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[4]

(b) Explain how you should change your program in Task 1 to allow a tutor to enter up to eight
candidates for the election.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2021 0478/21/M/J/21 [Turn over


4

(c) Write an algorithm using pseudocode, programming statements or a flowchart to show how
your program completes these parts of Task 2:
• Allows students to enter their unique voter number before casting their vote.
• Checks whether the student has already voted:
– if so, supplies a suitable message and does not allow them to vote.
– if not, stores the unique voter number, but not their vote, in a suitable data structure.

It is not necessary to show parts completed in Task 1, including counting of votes for each
candidate.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© UCLES 2021 0478/21/M/J/21


5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

© UCLES 2021 0478/21/M/J/21 [Turn over


6

(d) Explain how your program completes these parts of Task 3:


• Calculate the percentage of the votes that each candidate received from the number of
votes cast, excluding abstentions.
• Display the name of each candidate, the number of votes and the percentage of votes
they received from the number of votes cast, excluding abstentions.
• Display the total number of votes cast in the election and the number of abstentions.

Any programming statements used in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2021 0478/21/M/J/21
7

Section B

2 Tick (ü) one box in each row to identify if the statement is about validation, verification or both.

Validation Verification Both


Statement
(ü) (ü) (ü)
Entering the data twice to check if both entries are
the same.
Automatically checking that only numeric data has
been entered.
Checking data entered into a computer system
before it is stored or processed.
Visually checking that no errors have been
introduced during data entry.
[3]

3 Name and describe the most appropriate programming data type for each of the examples of data
given. Each data type must be different.

Data: 37

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Data: Cambridge2021

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Data: 47.86

Data type name ................................................................................................................................

Data type description .......................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2021 0478/21/M/J/21 [Turn over


8

4 The pseudocode algorithm shown has been written by a teacher to enter marks for the students in
her class and then to apply some simple processing.

Count 0 ←
REPEAT
INPUT Score[Count]
IF Score[Count] >= 70
THEN
Grade[Count] "A" ←
ELSE
IF Score[Count] >= 60
THEN
Grade[Count] "B" ←
ELSE
IF Score[Count] >= 50
THEN
Grade[Count] "C" ←
ELSE
IF Score[Count] >= 40
THEN
Grade[Count] "D" ←
ELSE
IF Score[Count] >= 30
THEN
Grade[Count] "E" ←
ELSE
Grade[Count] "F" ←
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Count ←
Count + 1
UNTIL Count = 30

(a) Describe what happens in this algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/M/J/21


9

(b) Write the pseudocode to output the contents of the arrays Score[] and Grade[] along with
suitable messages.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Describe how you could change the algorithm to allow teachers to use it with any size of
class.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/M/J/21 [Turn over


10

5 The flowchart represents an algorithm.

The algorithm will terminate if –1 is entered.

START

INPUT
Value

IS Yes
Value =
–1 ?
OUTPUT
"Reject: END
No
Abnormal"

IS
No Value >= 50
AND Value
<= 100 ?

Yes

Diff1 100 – Value

Diff2 Value – 50

IS
OUTPUT No Diff1 < 1 OR
"Accept: Normal" Diff2 < 1 ?

Yes

OUTPUT
"Accept:
Extreme"

© UCLES 2021 0478/21/M/J/21


11

(a) Complete the trace table for the input data:

50, 75, 99, 28, 82, 150, –1, 672, 80

Value Diff1 Diff2 OUTPUT

[4]

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2021 0478/21/M/J/21 [Turn over


12

6 A library uses a database table, GENRE, to keep a record of the number of books it has in each
genre.

ID GenreName Total Available Loaned Overdue


ABI Autobiography 500 250 250 20
BIO Biography 650 400 250 0
EDU Education 20200 10000 10200 1250
FAN Fantasy 1575 500 1075 13
GFI General Fiction 35253 23520 11733 0
GNF General Non-Fiction 25200 12020 13180 0
HFI Historical Fiction 6300 3500 2800 0
HNF Historical Non-Fiction 8000 1523 6477 0
HUM Humour 13500 9580 3920 46
MYS Mystery 26000 13269 12731 0
PFI Political Fiction 23561 10523 13038 500
PNF Political Non-Fiction 1823 750 1073 23
REF Reference 374 374 0 0
ROM Romance 18269 16800 1469 0
SAT Satirical 23567 12500 11067 0
SCF Science Fiction 36025 25000 11025 0
SPO Sport 45720 32687 13033 3256
THR Thriller 86000 46859 39141 0

(a) State the reason ID could be used as a primary key in the table GENRE.

...................................................................................................................................................

............................................................................................................................................. [1]

(b) State the number of records in the table GENRE.

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2021 0478/21/M/J/21


13

(c) Complete the query-by-example grid to display any genres with overdue books. Only display
the ID, GenreName and Overdue fields in order of the number of books overdue from largest
to smallest.

Field:

Table:

Sort:

Show:

Criteria:

or:

[4]

© UCLES 2021 0478/21/M/J/21


14

BLANK PAGE

© UCLES 2021 0478/21/M/J/21


15

BLANK PAGE

© UCLES 2021 0478/21/M/J/21


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/21/M/J/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/21


Paper 2 May/June 2021
MARK SCHEME
Maximum Mark: 50

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 May/June 2021 series for most Cambridge
IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.

This document consists of 11 printed pages.

© UCLES 2021 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to
be the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a MP has ellipsis at the beginning, but there is no ellipsis on the MP before it, then this is just a follow-on sentence and
can be awarded without the previous mark point.

© UCLES 2021 Page 4 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section A

1(a)(i) Many correct answers. They must be meaningful and related to Task 1. The names are examples only. 3

One mark per mark point

• Constant MaxCandidates
• Value 4
• Use The value of the maximum number of candidates for the election

1(a)(ii) Many correct answers. They must be meaningful and related to Task 1. The names are examples only. 4

One mark per mark point


• Variable NumberCandidates
• Use Storing the number of candidates in the election (for a tutor group)

• Array CandidateNames
• Use Storing the names of the candidates for the election

1(b) One mark per mark point (Max 4) 4


MP1 Change the value of the MaxCandidates constant/variable to 8
MP2 Change the input message to state the maximum number of candidates is 8 …
MP3 …how your program changed the input message
MP4 Change the loop limit to up to 8 …
MP5 …how your program changed the loop limit
MP6 Change the validation to allow input up to 8 …
MP7 …how your program changed its validation check
MP8 Change the array size(s) to ensure sufficient capacity to store up to 8 names …
MP9 …how your program changed the array sizes
MP10 Change the counters to ensure votes can be counted for up to 8 candidates …
MP11 …how your program changed its counters

© UCLES 2021 Page 5 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(c) Any five from: 5


MP1 Input with message to enter unique voter number
MP2 Validation of (unique) voter number entered e.g. length check/type check/range check
MP3 Attempt to check if voter number input is in list of possible voters
MP4 Attempt to check if they have already voted
MP5 If voter has already voted, message to warn them they can’t vote
MP6 Attempt at preventing them from voting
MP7 Store voter number in a suitable data structure

Example answer
OUTPUT "Please enter your unique voter number"
INPUT UniqueVoterNumber
FoundFlag ← False
AllNumbersChecked ← False
Counter ← 0
WHILE FoundFlag = False AND AllNumbersChecked = False
IF StudentNumbers[Counter] = ""
THEN
AllNumbersChecked = True
StudentNumbers[Counter] ← UniqueVoterNumber
ELSE
IF UniqueVoterNumber = StudentNumbers[Counter]
THEN
FoundFlag = True
PRINT “Sorry, you have already voted”
ELSE
Counter = Counter + 1
ENDIF
ENDIF
ENDWHILE
IF FoundFlag = False
THEN
OUTPUT "Please enter the code of your chosen candidate"
INPUT Vote
ENDIF

© UCLES 2021 Page 6 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(d) Explanation of how the program does the following: 4


Any four from:
MP1 Find out how many votes in total (for all candidates) were cast in the election.
MP2 For each candidate
MP3 … calculate the percentage of votes
MP4 … excluding abstentions.
MP5 Display the name of each candidate, the number of votes and the percentage of votes they received with
appropriate messages.
MP6 Display the number of votes cast and the number of abstentions with appropriate message.

© UCLES 2021 Page 7 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section B

2 One mark per correct column 3


Statement Validation Verification Both

Entering the data twice to check if both entries are the same. 

Automatically checking that only numeric data has been entered. 

Checking data entered into a computer system before it is stored or



processed.

Visually checking that no errors have been introduced during data



entry.

Question Answer Marks

3 One mark per bullet point 6


37
• Data type name Integer
• Data type description (Any) whole number

Cambridge2021
• Data type name String
• Data type description A group of characters/text

47.86
• Data type name Real
• Data type description (Any real) number that could be a whole number or a fraction

© UCLES 2021 Page 8 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(a) One mark per mark point (Max 3) 3


MP1 Marks input are stored in the array Score[]
MP2 Marks are checked against a range of boundaries // allow example
MP3 … and a matching grade is assigned to each mark that has been input
MP4 … then stored in the array Grade[]…
MP5 … at the same index as the mark input
MP6 The algorithm finishes after 30 marks have been input // allows 30 scores to be entered

4(b) One mark per mark point (Max 3) 3


MP1 Correct loop, including counter if not a FOR loop
MP2 Correct output of Score[]
MP3 Correct output of Grade[]
MP4 Suitable messages/text in output for both arrays

Example answers
Count ← 0
REPEAT
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ",Grade[Count]
Count ← Count + 1
UNTIL Count = 30

Count ← 0
WHILE Count < 30 DO
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ",Grade[Count]
Count ← Count + 1
ENDWHILE

FOR Count ← 0 TO 29
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ", Grade[Count]
NEXT

© UCLES 2021 Page 9 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(c) Any three correct statements (Max 3) e.g. 3


MP1 Add an input facility to allow teachers to enter the class size
MP2 Add a variable to store the input class size
MP3 Use the class size variable as the terminating condition for the loop
MP4 Make sure the arrays are sufficiently large to accommodate the largest possible class size

Question Answer Marks

5(a) One mark for each correct column (Max 4) 4

Value Diff1 Diff2 OUTPUT

50 50 0 Accept: Extreme

75 25 25 Accept: Normal

99 1 49 Accept: Normal

28 Reject: Abnormal

82 18 32 Accept: Normal

150 Reject: Abnormal

–1

© UCLES 2021 Page 10 of 11


0478/21 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

5(b) One mark per bullet point (Max 2) 2


• To output the type of test data
• … by performing a range check //… by checking if numbers are within the range 50 and 100 (inclusive) (or not).

Question Answer Marks

6(a) The data in the ID column/field is unique/not repeated in each row/record 1

6(b) 18 1

6(c) 4
Field: ID GenreName Overdue

Table: GENRE GENRE GENRE

Sort: Descending

Show:     

Criteria: >0

or:

One mark for the correct fields present and correctly named
One mark for correct table name and show box in all columns
One mark for correct sorting
One mark for correct search criterion

© UCLES 2021 Page 11 of 11


Cambridge IGCSE™
* 0 3 3 7 1 8 6 9 5 9 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming May/June 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Any blank pages are indicated.

DC (LK) 202758/1
© UCLES 2021 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.

Pre-release material

An electric mountain railway makes four return trips every day. In each trip the train goes up the
mountain and back down. The train leaves from the foot of the mountain at 09:00, 11:00, 13:00 and
15:00. The train returns from the top of the mountain at 10:00, 12:00, 14:00 and 16:00. Each train
has six coaches with eighty seats available in each coach. Passengers can only purchase a return
ticket; all tickets must be purchased on the day of travel. The cost is $25 for the journey up and
$25 for the journey down. Groups of between ten and eighty passengers inclusive get a free ticket
for every tenth passenger, provided they all travel together (every tenth passenger travels free).
Passengers must book their return train journey, as well as the departure train journey, when they
purchase their ticket. Passengers can return on the next train down the mountain or a later train.
The last train from the top of the mountain has two extra coaches on it.

The train times are displayed on a large screen, together with the number of tickets still available
for each train. Every time a ticket is booked the display is updated. When a train is full, the word
‘Closed’ is displayed instead of the number of tickets available.

Write and test a program or programs for the electric mountain railway.

• Your program or programs must include appropriate prompts for the entry of data; data must
be validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – Start of the day.


Write a program to set up the screen display for the start of the day. Initialise suitable data structure(s)
to total passengers for each train journey and total the money taken for each train journey. Each
train journey must be totalled separately. There are four journeys up and four journeys down every
day.

Task 2 – Purchasing tickets.


Tickets can be purchased for a single passenger or a group. When making a purchase, check
that the number of tickets for the required train journeys up and down the mountain is available. If
the tickets are available, calculate the total price including any group discount. Update the screen
display and the data for the totals.

Task 3 – End of the day.


Display the number of passengers that travelled on each train journey and the total money taken
for each train journey. Calculate and display the total number of passengers and the total amount
of money taken for the day. Find and display the train journey with the most passengers that day.

© UCLES 2021 0478/22/M/J/21


3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify and give the data type and use of one array that you could have used for Task 1.

Array .........................................................................................................................................

Data type ..................................................................................................................................

Use ...........................................................................................................................................
[3]

(b) Describe two validation checks that could be used when inputting the number of tickets to
buy for Task 2. For each validation check give one example of normal data and one example
of erroneous data.

Validation check 1 .....................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Normal data ..............................................................................................................................

Erroneous data .........................................................................................................................

Validation check 2 .....................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Normal data ..............................................................................................................................

Erroneous data .........................................................................................................................


[6]

© UCLES 2021 0478/22/M/J/21 [Turn over


4

(c) Write an algorithm for the part of Task 2 that inputs the tickets required, calculates the total
price for the ticket(s) purchased by a passenger including a group discount (if applicable) and
updates the data structures used for the totals.
Use either pseudocode, programming statements or a flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2021 0478/22/M/J/21
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2021 0478/22/M/J/21 [Turn over


6

(d) Explain how your program completed Task 3. Include any programming statements that you
have used and fully explain the purpose of each statement.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

© UCLES 2021 0478/22/M/J/21


7

Section B starts on page 8

© UCLES 2021 0478/22/M/J/21 [Turn over


8

Section B

2 (a) Write an algorithm in pseudocode to input 500 positive whole numbers. Each number input
must be less than 1000. Find and output the largest number input, the smallest number input
and the range (difference between the largest number and smallest number).

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2021 0478/22/M/J/21


9

(b) Describe how the algorithm could be changed to make testing less time-consuming.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

3 (a) Draw the most appropriate flowchart symbol for each pseudocode statement.

Pseudocode statement Flowchart symbol

IF Number = 20

PRINT Number

Number ← Number + 1

[3]

(b) State the type of each pseudocode statement. For example, X ← X + Y is totalling.
IF Number = 20 ...................................................................................................................

PRINT Number ........................................................................................................................

Number ← Number + 1 ......................................................................................................


[3]

© UCLES 2021 0478/22/M/J/21 [Turn over


10

4 This algorithm checks passwords.

• Each password must be 8 or more characters in length; the predefined function Length
returns the number of characters.
• Each password is entered twice, and the two entries must match.
• Either Accept or Reject is output.
• An input of 999 stops the process.

REPEAT
OUTPUT "Please enter password"
INPUT Password
IF Length(Password) >= 8
THEN
INPUT PasswordRepeat
IF Password <> PasswordRepeat
THEN
OUTPUT "Reject"
ELSE
OUTPUT "Accept"
ENDIF
ELSE
OUTPUT "Reject"
ENDIF
UNTIL Password = 999

(a) Complete the trace table for the algorithm using this input data:
Secret, Secret, VerySecret, VerySecret, Pa55word, Pa55word, 999, 888

Password PasswordRepeat OUTPUT

[3]

© UCLES 2021 0478/22/M/J/21


11

(b) Explain how the algorithm could be extended to allow three attempts at inputting the matching
password. Any pseudocode statements used in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................ [4]

5 A one-dimensional array dataArray[1:20] needs each element set to zero.

(a) Write a pseudocode routine that sets each element to zero. Use the most suitable loop
structure.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(b) Explain why you chose this loop structure.

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2021 0478/22/M/J/21 [Turn over


12

6 A database table, PLANT, is used to keep a record of plants sold by a nursery. The table has these
fields:
• NAME – name of plant
• FLOWER – whether the plant flowers (True) or not (False)
• POSITION – shade, partial shade or sun
• SIZE – small, medium or large
• PRICE – price in $
• NUMBERSOLD – how many sold

A query-by-example grid has been completed to display only the price, name and number sold of
small plants that do not flower.

Field: NAME PRICE NUMBERSOLD SIZE FLOWER POSITION

Table: PLANT

Sort:

Show: 3 3 3

Criteria: = "shade"

or:

Identify the errors in the query-by-example grid.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Rewrite the corrected query-by-example grid.

Field:

Table:

Sort:

Show:

Criteria:

or:

[5]

© UCLES 2021 0478/22/M/J/21


13

BLANK PAGE

© UCLES 2021 0478/22/M/J/21


14

BLANK PAGE

© UCLES 2021 0478/22/M/J/21


15

BLANK PAGE

© UCLES 2021 0478/22/M/J/21


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/22/M/J/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/22


Paper 2 May/June 2021
MARK SCHEME
Maximum Mark: 50

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 May/June 2021 series for most Cambridge
IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.

This document consists of 13 printed pages.

© UCLES 2021 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to be
the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a MP has ellipsis at the beginning, but there is no ellipsis on the MP before it, then this is just a follow-on sentence and can
be awarded without the previous mark point.

© UCLES 2021 Page 4 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section A

1(a) Array TrainUpPassengers // TrainUpPassengers[] 3


Data type Integer/int
Use storing the number of passengers on the train journeys up

Many correct answers, this is an example.

1(b) One mark for description, one mark for normal data and one mark for erroneous data for two checks 6

Validation check (type check) to check that the number entered is a whole number / integer
Normal data 34
Erroneous data two // 1.5

Validation check (range check) to check that the value of the number entered is between 1 and 80 / 480 inclusive
Normal data 34
Erroneous data 99 // 500

Validation check (presence check) to check that a value has been entered
Normal data 34 // any data entered
Erroneous data “” // blank // no data entered

Validation check (length check) to check that a value has 3 digits or fewer // between 1 and 3 digits
Normal data 345
Erroneous data 3456

Many correct answers, the data are examples only.

© UCLES 2021 Page 5 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(c) Any six from: 6


MP1 Input number of tickets
MP2 Input train up mountain and train down mountain
MP3 Suitable prompts seen for inputs that are included
MP4 Check that tickets are available on selected train(s)
MP5 If available calculate price of tickets …
MP6 … calculation includes discount if required
MP7 Update total passengers / seats available for a train
MP8 Update total passengers / seats available for up train and down train
MP9 Update total cost for a train
MP10 Update total cost for up train and down train

Example answers
OUTPUT "How many tickets"
INPUT NoTickets
OUTPUT "Which Train up the mountain? 1, 2, 3 or 4"
INPUT UpNumber
OUTPUT "Which Train down the mountain? 1, 2, 3 or 4"
INPUT DownNumber
IF (DownNumber = 4 AND TrainUp[UpNumber] + NoTickets <= 480 AND TrainDown[DownNumber] +
NoTickets <= 640) OR (TrainUp[UpNumber] + NoTickets <= 480 AND TrainDown[DownNumber] +
NoTickets <= 480)
THEN
Cost ← (NoTickets – NoTickets DIV 10) * 50
TrainUp[UpNumber] ← TrainUp[UpNumber] + NoTickets
TrainDown[DownNumber] ← TrainUp[DownNumber] + NoTickets
TrainUpTotal[UpNumber] ← TrainUpTotal[UpNumber] + Cost / 2
TrainDownTotal[DownNumber] ← TrainDownTotal[DownNumber] + Cost / 2
ENDIF

© UCLES 2021 Page 6 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(c)
START

OUTPUT "Tickets"
INPUT Tickets

OUTPUT "Up Train"


INPUT UpNo

OUTPUT "Down Train"


Yes
INPUT DownNo

Is Tickets <= No
UpTickets[UpNo] AND
Tickets <=
DownTickets[DownNo]?

Yes

Cost ← (NoTickets – NoTickets DIV 10) * 50

TrainUp[UpNo] ← TrainUp[UpNo] + NoTickets


TrainDown[DownNo] ← TrainUp[DownNo] + NoTickets
TrainUpTotal[UpNo] ← TrainUpTotal[UpNo] + Cost / 2
TrainDownTotal[DownNo] ← TrainDownTotal[DownNo] + Cost / 2

END

© UCLES 2021 Page 7 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(d) Explanation 5
Any five from:
MP1 How the program displayed the number of passengers for a journey ...
MP2 … how completed for all trains
MP3 How the program displayed the amount of money taken for a journey …
MP4 … how completed for all trains
MP5 How the program calculated the total number of passengers
MP6 How the program calculated the total money taken
MP7 How the program attempted to select the train journey with the most passengers
MP8 How the program attempted to dealt with more than one train being the most popular
MP9 How the program displayed the results with suitable messages

Programming statements must be given with each explanation.

© UCLES 2021 Page 8 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section B

2(a) Any six from: 6


MP1 Initialisation of large and small variables e.g. Large ← 0 Small ← 1000
MP2 Use of a loop for 500 entries // or 499 if initialisation done on first correct entry
MP3 Input with prompt
MP4 Attempt at checking the range of 1 to 999 for input
MP5 … working range check
MP6 Checking for a whole number
MP7 Selecting largest number
MP8 Selecting smallest number
MP9 Calculating the range
MP10 Outputting the largest, smallest and range with message
Large ← 0
Small ← 1000
FOR Count ← 1 TO 500
REPEAT
OUTPUT "Enter a whole number between 1 and 999"
INPUT Number
UNTIL Number >= 1 AND Number < 1000 AND Number = Number DIV 1
IF Number < Small
THEN
Small ← Number
ENDIF
IF Number > Large
THEN
Large ← Number
ENDIF
NEXT
Range ← Large – Small
OUTPUT "Largest number is ", Large, " Smallest number is ", Small, " Range of numbers is
", Range

© UCLES 2021 Page 9 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

2(b) One mark for action required and one mark for method used 2

Reduce the amount of numbers entered


By decreasing the final value of the loop
or
Remove the need to input values
By using random numbers / a previously populated array

3(a) 3
Pseudocode statement Flowchart symbol

IF Number = 20

PRINT Number

Number ← Number + 1

3(b) IF Number = 20 selection 3


PRINT Number output
Number ← Number + 1 counting

© UCLES 2021 Page 10 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(a) One mark for each correct column 3

Password PasswordRepeat OUTPUT

(Please enter password)

Secret Reject

(Please enter password)

Secret Reject

(Please enter password)

VerySecret VerySecret Accept

(Please enter password)

Pa55word Pa55word Accept

(Please enter password)

999 Reject

© UCLES 2021 Page 11 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(b) Any four from: 4


• Position: before INPUT PasswordRepeat // at start
• …use a (variable) counter (for number of tries) or flag
• … initialise variable counter or flag

• Position after IF Length(Password) >= 8 THEN or after INPUT PasswordRepeat


• … insert REPEAT/WHILE/(conditional) loop

• Position after OUTPUT "Reject"


• … add one to counter (for number of tries)
• … output a message "Try again"
• … add INPUT PasswordRepeat

• Position after OUTPUT "Accept"


• … reset flag to show password matched

• Position after ENDIF


• … (insert UNTIL/ENDWHILE)to exit the loop after three tries or if the repeated password matches the original

Question Answer Marks

5(a) One mark for: 3


• Use of FOR loop
• Working loop with correct number of Iterations
• Correct assignment
FOR Count ← 1 TO 20
dataArray[Count] ← 0
NEXT (Count)

5(b) (A FOR loop has) a fixed number of repetitions // 1


No need to manage the loop counter //
no need to use another variable for the array index

© UCLES 2021 Page 12 of 13


0478/22 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

6 Any three from: 5


• TABLE row not completed
• POSITION column not required // POSITION criteria not required
• No criteria set in the size column
• No criteria set in the flower column

Field: SIZE PRICE FLOWER NUMBERSOLD NAME

Table: PLANT PLANT PLANT PLANT PLANT

Sort:

Show:     

Criteria: ="small" False

or:

OR

Field: SIZE PRICE FLOWER NUMBERSOLD NAME POSITION

Table: PLANT PLANT PLANT PLANT PLANT PLANT

Sort:

Show:      

Criteria: ="small" = False

or:

One mark for correct rows Field, Table and Show


One mark for correct Criteria row

© UCLES 2021 Page 13 of 13


Cambridge IGCSE™
* 9 0 6 0 9 6 0 7 7 2 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming May/June 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages.

DC (KN/SG) 202761/2
© UCLES 2021 [Turn over
2

Section A
You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the tasks before the examination to
answer Question 1.
Pre-release material

A school would like a system to allow students and staff to show their preference on matters relating
to the school, such as a proposal for changing the start and finish times of the school day.
Option Proposed start and finish times of the school day
A Start: 08:00 – Finish: 15:00
B Start: 08:20 – Finish: 15:20
C Start: 08:40 – Finish: 15:40
D Start: 09:00 – Finish: 16:00
E Start: 09:30 – Finish: 16:30
The school has 150 students and 20 members of staff. The system is required to accept preferences,
and count and report the results to show student preferences, staff preferences and overall results.
Write and test a program or programs for the system.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – Setting up the system and recording preferences.
Set up a system to allow preferences to be recorded for each of five different options, labelled A to E.
• Allow a description for each option to be entered.
• Allow students and staff to enter their unique number before their preferences can be entered
(everyone is given a unique number by the school).
• Check if the unique number has already been used:
○ if so, supply a suitable message and do not allow preferences to be entered
○ if not:
• record that the entered unique number has been used
• allow preferences from 1 to 5 to be entered for each option (1 is ‘strongly agree’ and
5 is ‘strongly disagree’)
• store the preferences in suitable data structures, keeping student and staff preferences
separate.
Task 2 – Totalling the preferences and reporting the results.
Extend Task 1 to achieve the following:
• Allow the preferences for each of the options to be totalled, keeping student and staff
preferences separate.
• Display the results as a list of the options, with the totals given for each one as:
○ student results
○ staff results
○ combined results.
Task 3 – Changing the program to include a counting method.
Extend Task 2 to achieve the following:
• Count the number of times the preference 1, ‘strongly agree’, was given for each option,
counting student and staff preferences separately.
• Display the results as a list of the options, with the number of times preference 1 was given for
each option as:
○ student results
○ staff results
○ combined results.

© UCLES 2021 0478/23/M/J/21


3

1 (a) All variables, constants and other identifiers must have meaningful names.

(i) Identify one constant you could have used for Task 1. Give the value that would be
assigned to the constant and explain its use.

Constant ............................................................................................................................

Value .................................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[3]

(ii) Identify one variable you could have used for Task 1 and explain its use.

Variable .............................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(iii) Describe one array you could have used for Task 1. Include the name, data type, length,
sample data and use for that array.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [4]

© UCLES 2021 0478/23/M/J/21 [Turn over


4

(b) Write an algorithm for Task 2, using pseudocode, programming statements or a flowchart. It
is not necessary to show details completed in Task 1.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2021 0478/23/M/J/21
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]
© UCLES 2021 0478/23/M/J/21 [Turn over
6

(c) Explain how you could change your program in Task 1 to allow the number of options
available to be increased to six.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(d) Explain how your program counts the number of times students enter preference 1 (‘strongly
agree’) for each option (A to E), part of Task 3. Any programming statements used in your
answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/23/M/J/21


7

Section B

2 Draw a line to connect each Data Type to the most appropriate Description.

Data Type Description

Real Must be a whole number

String Must be one of two values

Integer May be any number

Boolean May contain any combination of characters


[3]

3 Identify a suitable validation check that could be used for each piece of normal test data and
describe how it would be used. Each validation check must be different.

Test data for entering an email address: id27@[Link]

Validation check name .....................................................................................................................

Description of use ............................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Test data for entering a year: 2021

Validation check name .....................................................................................................................

Description of use ............................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Test data for entering a name: Ericson-Bower

Validation check name .....................................................................................................................

Description of use ............................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[6]
© UCLES 2021 0478/23/M/J/21 [Turn over
8

4 The pseudocode algorithm should allow a user to input the number of scores to be entered and
then enter the scores. The scores are totalled, the total is output and the option to enter another
set of scores is offered.

1 Count 0 ←
2 REPEAT
3 FullScore 20 ←
4 INPUT Number
5 FOR StoreLoop 1 TO Number ←
6 INPUT Score
7 FullScore FullScore ←
8 UNTIL StoreLoop = Number
9 OUTPUT "The full score is ", FullScore
10 OUTPUT "Another set of scores (Y or N)?"
11 OUTPUT Another
12 IF Another = "N"
13 THEN
14 Count 1 ←
15 ENDIF
16 UNTIL Count = 1

(a) Identify the four errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2021 0478/23/M/J/21


9

(b) Show how you could change the algorithm to store the individual scores in the array
ScoreArray[], then find and print the average score once the scores have all been entered.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2021 0478/23/M/J/21 [Turn over


10

5 The flowchart represents an algorithm.

The algorithm will terminate if 0 is entered at the Op input.

START

INPUT
Op

IS No
Op = 0 ?

Yes
INPUT
Value1

INPUT
Value2

IS Yes
Op = 1 ? Ans Value1 + Value2

END No

IS Yes
Op = 2 ? Ans Value1 - Value2

No

IS Yes
Op = 3 ? Ans Value1 * Value2

No

IS Yes
Op = 4 ? Ans Value1 / Value2

No

OUTPUT
"Input Error"

© UCLES 2021 0478/23/M/J/21


11

(a) Complete the trace table for the algorithm using this input data:

1, 87, 14, 3, 2, 30, 5, 10, 6, 4, 10, 2, 0, 2, 90, 6

Op Value1 Value2 Ans OUTPUT

[5]

(b) State the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [1]

(c) Suggest an addition that could be made to the algorithm to make it more useful.

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2021 0478/23/M/J/21 [Turn over


12

6 A car hire company uses a database table, TREAD, to store details of the cars. The table has
fields to represent each car’s licence number, mileage, and the tread depth of each of its four
tyres.

(a) Suggest suitable names for each of the fields described.

Field name

[2]

(b) Complete the query-by-example grid to display cars where all four tyres have a tread depth
of less than 2. Display all the fields, using the field names you created in part (a). The output
should be sorted by licence number.

Field:

Table:

Sort:

Show: o o o o o o
Criteria:

or:
[4]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/23/M/J/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/23


Paper 2 May/June 2021
MARK SCHEME
Maximum Mark: 50

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 May/June 2021 series for most Cambridge
IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.

This document consists of 17 printed pages.

© UCLES 2021 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to
be the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a MP has ellipsis at the beginning, but there is no ellipsis on the MP before it, then this is just a follow-on sentence and
can be awarded without the previous mark point.

© UCLES 2021 Page 4 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section A

1(a)(i) One mark per bullet point 3


• Constant NumberofOptions
• Value 5
• Use Storing the maximum number of options (for the referendum)

1(a)(ii) One mark per bullet point 2


• Variable UniqueNumber
• Use Storing/inputting the voter’s unique identification number

1(a)(iii) One mark for each valid mark point (Max 4) 4

• Suitable name e.g. IdNumber


• Suitable data type e.g. Integer
• Suitable array length e.g. 170 (elements)
• Suitable sample data e.g. 100
• Suitable use e.g. to store the unique numbers

© UCLES 2021 Page 5 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(b) Any six from: 6


MP1 Initialisation of totalling variables
MP2 Loop to cycle through all the data
MP3 Totalling the votes for at least one of the options
MP4 Totalling the votes for all five options
MP5 Separate totals for students and staff
MP6 Output to show one set of results
MP7 Output to show more than one set of results with messages
MP8 Comprehensive output to show student, staff and combined results, with messages

Example answers
Version 1
TotalAS ← 0; TotalBS ← 0; TotalCS ← 0; TotalDS ← 0; TotalsES ← 0; TotalAF ← 0;
TotalBF ← 0; TotalCF ← 0; TotalDF ← 0; TotalEF ← 0
FOR Count ← 0 TO 150
TotalAS ← TotalAS + StudentA[Count]
TotalBS ← TotalBS + StudentB[Count]
TotalCS ← TotalCS + StudentC[Count]
TotalDS ← TotalDS + StudentD[Count]
TotalES ← TotalES + StudentE[Count]
NEXT Count
FOR Count = 0 TO 20
TotalAF ← TotalAF + StaffA [Count]
TotalBF ← TotalBF + StaffA [Count]
TotalCF ← TotalCF + StaffA [Count]
TotalDF ← TotalDF + StaffA [Count]
TotalEF ← TotalEF + StaffA [Count]
NEXT Count
OUTPUT "Option Students Staff Total"
OUTPUT "A ", TotalAS, TotalAF, (TotalAS + TotalAF)
OUTPUT "B ", TotalBS, TotalBF, (TotalBS + TotalBF)
OUTPUT "C ", TotalCS, TotalCF, (TotalCS + TotalCF)
OUTPUT "D ", TotalDS, TotalDF, (TotalDS + TotalDF)
OUTPUT "E ", TotalES, TotalEF, (TotalES + TotalEF)

© UCLES 2021 Page 6 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(b) Version 2
TotalAS ← 0; TotalBS ← 0; TotalCS ← 0; TotalDS ← 0; TotalsES ← 0; TotalAF ← 0;
TotalBF ← 0; TotalCF ← 0; TotalDF ← 0; TotalEF ← 0
OUTPUT "Are you a student? (Y or N)"
INPUT Student
IF Student = "Y" THEN
OUTPUT "Enter your number"
INPUT Number
IF Students[Number] = 0 THEN
REPEAT
OUTPUT "Enter preference for A"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalAS ← TotalAS + Vote
REPEAT
OUTPUT "Enter preference for B"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalBS ← TotalBS + Vote
REPEAT
OUTPUT "Enter preference for C"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalCS ← TotalCS + Vote
REPEAT
OUTPUT "Enter preference for D"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalDS ← TotalDS + Vote
REPEAT
OUTPUT "Enter preference for E"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalES ← TotalES + Vote

© UCLES 2021 Page 7 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(b) Student[Number] ← 1
ELSE
OUTPUT "Enter your number"
INPUT Number
IF staff[number] = 0 THEN
REPEAT
OUTPUT "Enter preference for A"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalAS ← TotalAS + Vote
REPEAT
OUTPUT "Enter preference for B"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalBS ← TotalBS + Vote
REPEAT
OUTPUT "Enter preference for C"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalCS ← TotalCS + Vote
REPEAT
OUTPUT "Enter preference for D"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalDS ← TotalDS + Vote
REPEAT
OUTPUT "Enter preference for E"
INPUT Vote
UNTIL Vote >= 1 and Vote <= 5
TotalES ← TotalES + Vote
Staff[Number] ← 1
ENDIF

© UCLES 2021 Page 8 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

1(b) OUTPUT "Option Students Staff Total"


OUTPUT "A ", TotalAS, TotalAF, (TotalAS + TotalAF)
OUTPUT "B ", TotalBS, TotalBF, (TotalBS + TotalBF)
OUTPUT "C ", TotalCS, TotalCF, (TotalCS + TotalCF)
OUTPUT "D ", TotalDS, TotalDF, (TotalDS + TotalDF)
OUTPUT "E ", TotalES, TotalEF, (TotalES + TotalEF)

1(c) Any two from: 2


MP1 Change the maximum preferences constant to 6
MP2 Change the input prompt to show six options
MP3 Change the loop counter
MP4 Change the number of inputs for each person to six
MP5 Add another array/variable to store/total the new option votes

1(d) Explanation 3
Any three from:
MP1 Initialise count variables/array for each option
MP2 Using a conditional statement to identify preference 1 in at least one option (in the input/stored data)
MP3 … identify preference 1 in all options
MP4 ... and adding 1 to the appropriate option count in at least one option
MP5 … for students only
MP6 … using a loop to cycle through the whole array/set of inputs for each option

© UCLES 2021 Page 9 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

Section B

2 Three marks for three or four correct 3


Two marks for two correct
One mark for one correct

Data Type Description

Real Must be a whole number

String Must be one of two values

Integer May be any number

Boolean May contain any combination of


characters

© UCLES 2021 Page 10 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

3 One mark per mark point for each piece of test data (3 × two marks) 6
• Correct validation check name
• Correct use identified

Example answers

Id27@[Link]
• Validation check name Length (check)
• Use Counts the number of characters in the data to make sure it isn’t too long (max length 320
characters).

2021
• Validation check name Range (check)
• Use Checks that the number entered fits within given parameters

Ericson-Bower
• Validation check name Type (check)
• Use Checks the type of data entered (in this case) to make sure no numbers are present

© UCLES 2021 Page 11 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(a) One mark for error identified and suggested correction 4

Line 3 – should be FullScore ← 0


Line 7 – should be FullScore ← FullScore + Score
Line 8 – should be NEXT Allow ENDFOR // alternatively Line 5 could be REPEAT with StoreLoop ← 0 just above
it and StoreLoop ← StoreLoop + 1 between lines 7 and 8.
Line 11 – should be INPUT Another

Correct Algorithm 1
1 Count ← 0
2 REPEAT
3 FullScore ← 0
4 INPUT Number
5 FOR StoreLoop ← 1 TO Number
6 INPUT Score
7 FullScore ← FullScore + Score
8 NEXT
9 OUTPUT "The full score is ", FullScore
10 OUTPUT "Another set of scores (Y or N)?"
11 INPUT Another
12 IF Another = "N"
13 THEN
14 Count ← 1
15 ENDIF
16 UNTIL Count = 1

© UCLES 2021 Page 12 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(a) Correct Algorithm 2


1 Count ← 0
2 REPEAT
3 FullScore ← 0
4 INPUT Number
StoreLoop ← 0
5 REPEAT
6 INPUT Score
7 FullScore ← FullScore + Score
StoreLoop ← StoreLoop + 1
8 UNTIL StoreLoop = Number
9 OUTPUT "The full score is ", FullScore
10 OUTPUT "Another set of scores (Y or N)?"
11 INPUT Another
12 IF Another = "N"
13 THEN
14 Count ← 1
15 ENDIF
16 UNTIL Count = 1

© UCLES 2021 Page 13 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

4(b) One mark per mark point (Max 4) 4

MP1 After line 6 // replace line 6


MP2 ScoreArray[StoreLoop] ← Score //
INPUT ScoreArray[StoreLoop]

MP3 between lines 8 and 10


MP4 AverageScore ← FullScore/Number
MP5 OUTPUT "The average score is ", AverageScore

Example correct algorithm for reference from part 4(a)

1 Count ← 0
2 REPEAT
3 FullScore ← 0
4 INPUT Number
5 FOR StoreLoop ← 1 TO Number
6 INPUT Score
7 FullScore ← FullScore + Score
8 NEXT
9 OUTPUT "The full score is ", FullScore
10 OUTPUT "Another set of scores (Y or N)?"
11 INPUT Another
12 IF Another = "N"
13 THEN
14 Count ← 1
15 ENDIF
16 UNTIL Count = 1

© UCLES 2021 Page 14 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

5(a) One mark for each correct column 5

Op Value1 Value2 Ans OUTPUT


1
87
14 101
3
2
30 60
5
10
6 Input Error
4
10
2 5
0

© UCLES 2021 Page 15 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

5(b) To work as a calculator // to add, subtract, multiply or divide a pair of numbers 1

5(c) To output/store the result/the value of Ans // Adding prompts for data entry. 1

Question Answer Marks

6(a) Two marks for six correct field names 2


One mark for at least three correct field names

Field name

LicenceNo

Mileage

TyreFLft

TyreFRgt

TyreRLft

TyreRRgt

© UCLES 2021 Page 16 of 17


0478/23 Cambridge IGCSE – Mark Scheme May/June 2021
PUBLISHED
Question Answer Marks

6(b) One mark for correct fieldnames 4


One mark for correct table names and show fields
One mark for correct sort
One mark for correct search criteria in all columns

Field: LicenceNo Mileage TyreFLft TyreFRgt TyreRLft TyreRRgt

Table: TREAD TREAD TREAD TREAD TREAD TREAD

Sort: Ascending

Show:      

Criteria: <2 <2 <2 <2

or:

© UCLES 2021 Page 17 of 17


Cambridge IGCSE™
* 0 6 7 1 1 5 7 2 5 3 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming October/November 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Any blank pages are indicated.

DC (RW/AR) 202716/5
© UCLES 2021 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.

Pre-release material

A holiday park has eight squash courts that can be booked for an hour at a time. The first booking
is from 08:00 to 09:00 and the last booking is from 17:00 to 18:00. All bookings start on the hour
and bookings can only be made on the same day that the squash court is used. A screen displays
today’s date and how many squash courts are available for each hour.

When a booking is made, the name of the guest is recorded together with their mobile phone number.
Once the squash court is booked, the guest is shown the court number together with a unique 4-digit
code that can be used to unlock the squash court. Each booking is for one squash court for one
hour. The 4-digit code must be different for each booking.

Write and test a program or programs for a computer system to manage the daily squash court
bookings.

• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – at the start of the day

Write a program to set up arrays to record the following for each hour:
• whether a squash court is booked or available
• the name of the guest
• the mobile phone number of the guest
• the unique 4-digit code for the booking.
Set up a screen to display the court availability at the start of the day.

Task 2 – making a squash court booking

Check if there is a squash court available at the time requested. If a squash court is available,
record the guest’s name and mobile phone number. Mark the squash court as booked for that hour.
Generate and record the unique 4-digit code for the booking. Display the mobile phone number for
the guest to check, display the court number and the 4-digit code for the guest to remember. Display
the updated court availability, showing an hour as fully booked if all the squash courts are now
booked for that hour.

Task 3 – at the end of the day

Calculate the total number of squash court bookings. Find the hour(s) and court(s) with the most
bookings. Display this information.

© UCLES 2021 0478/21/O/N/21


3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify one constant that you could have used for Task 1. Give the value that would be
assigned to this constant. State the use of this constant.

Constant ...................................................................................................................................

Value .........................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................
[3]

(b) Describe the arrays that you have set up in Task 1 to record today’s data about the squash
courts.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(c) Explain how your program generates a unique 4-digit code for each booking.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/O/N/21 [Turn over


4

(d) Write an algorithm for Task 2. You do not need to display updated court availability. Use
either pseudocode, programming statements or a flowchart. Assume that Task 1 has been
completed.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© UCLES 2021 0478/21/O/N/21


5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2021 0478/21/O/N/21 [Turn over


6

(e) Explain how your program completed the part of Task 3 which calculates the total number of
squash court bookings, finds the court(s) with the most bookings and displays this information.
Include any programming statements that you have used and fully explain the purpose of
each statement.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2021 0478/21/O/N/21


7

Section B starts on Page 8

© UCLES 2021 0478/21/O/N/21 [Turn over


8

Section B

2 An algorithm has been written in pseudocode to generate 50 positive random integers with values
less than or equal to 100. These random integers are stored in the array RandNum[ ]

The function Rand(X, Y) generates a random integer greater than or equal to X and less than Y.
For example, Rand(1, 4) generates 1 or 2 or 3.

1 Count 0
2 REPEAT
3 RandNum[Counter] Rand(1, 100)
4 Count Count + 2
5 UNTIL Count <= 50

(a) Find the four errors in the pseudocode and write a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2021 0478/21/O/N/21


9

(b) The pseudocode for this algorithm could be shortened by the use of a FOR … NEXT loop.

Rewrite the algorithm using a FOR … NEXT loop.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Identify another loop structure available in pseudocode.

............................................................................................................................................. [1]

3 A program has been written to check the value of a measurement. The measurement must be a
positive number and given to three decimal places, for example, 3.982

(a) (i) State suitable examples of normal and erroneous test data that could be used to test this
program. For each example give the reason for your choice of test data.

Normal test data example .................................................................................................

Reason ..............................................................................................................................

...........................................................................................................................................

Erroneous test data example ............................................................................................

Reason ..............................................................................................................................

...........................................................................................................................................
[4]

(ii) Explain why two pieces of boundary test data are required for this program.
Give an example of each piece of boundary test data.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

© UCLES 2021 0478/21/O/N/21 [Turn over


10

(b) Explain why verification is needed and how verification could be performed by this program.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/21/O/N/21


11

Question 4 starts on Page 12

© UCLES 2021 0478/21/O/N/21 [Turn over


12

4 The algorithm shown by this flowchart allows the input of examination marks for a class of students.
A mark of –1 ends the process. If a mark is 80 or over then a distinction grade is awarded. The
number of distinctions for the whole class is calculated. If this is over 50% of the class, the class is
awarded a highly commended certificate.

START

←0
←0
Counter
Distinction

INPUT
Mark

IS
Mark = –1?
Yes
Award ← Distinction/Counter
No

Counter ← Counter + 1 IS
Award > 0.5?
Yes OUTPUT
"Highly
Commended"

No

Distinction ← Distinction + 1
END

Yes IS
Mark >= 80?

No

© UCLES 2021 0478/21/O/N/21


13

Complete a trace table for the algorithm using this input data:
88, 74, 60, 90, 84, 87, 95, 72, 84, 66, –1

Counter Distinction Mark Award OUTPUT

[5]

© UCLES 2021 0478/21/O/N/21 [Turn over


14

5 A database table, APPLIANCE, is used to keep a record of kitchen appliances available for sale.

The following data is stored for each appliance:

• CATEGORY – washer, dishwasher, fridge or freezer


• ECONOMYRATING – A, B, C or D
• MANUFACTURER – Baku or ABC
• PRICE – price in $
• CODE – a unique code allocated by the manufacturer e.g. B982
• STOCK – number in stock.

The database management system uses these data types:

Text Number Currency Boolean

The ECONOMYRATING field and MANUFACTURER field have a data type of text.

(a) Identify the most appropriate data type for each field from the four types shown. State the
reason why you chose each data type.

CATEGORY data type ..............................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

PRICE data type .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

CODE data type .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

STOCK data type ......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2021 0478/21/O/N/21


15

(b) Complete the query-by-example grid to display only the category, manufacturer and code of
the appliances with an economy rating of A.

Field:
Table:
Sort:
Show:
Criteria:
or:
[3]

© UCLES 2021 0478/21/O/N/21


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/21/O/N/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/21


Paper 2 October/November 2021
MARK SCHEME
Maximum Mark: 50

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 2021 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This document consists of 11 printed pages.

© UCLES 2021 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section A

1(a) Constant NoCourts // NoSessions // NoBookingSlots 3


Value 8 // 10 // 80
Use Storing the number of courts / sessions available / times and courts available for booking

1(b) Any four from: 4

Any three from


MP1 Identifier / name of array used
MP2 Description of purpose of an identified array
MP3 Length of an identified array used
MP4 Type of data in an identified array
MP5 Explanation of number of arrays used, must be capable of storing all data required
MP6 Sample data for an identified array

One mark
MP7 Identifying more than one array

E.g.4 arrays of ten elements for each squash court, for example for squash court 1 Availability1 of type Boolean,
Guest1, Mobile1 and Code1 all type string

1(c) Any three from: 3

MP1 Setting the first code number


MP2 How to find subsequent code numbers
MP3 How to ensure they were unique
MP4 How to ensure they were exactly 4 digits

© UCLES 2021 Page 4 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

1(d) Any six from: 6


MP1 Input time
MP2 … with prompt
MP3 Check each court
MP4 If court not booked …
MP5 … set as booked
MP6 Input name, mobile number
MP7 Calculate unique 4-digit code
MP8 Store name, mobile number and 4-digit code in an array
MP9 Display mobile number and 4-digit code with suitable message
MP10 Change mobile number if necessary

Sample
OUTPUT ("Which time do you want to book a squash court")
INPUT BookTime
Booked ← FALSE
CourtNumber ← 0
IF BookTime >= 8 AND BookTime <= 17
THEN
BookTime ← BookTime - 7
IF Available1[BookTime] THEN Available1[BookTime] ← FALSE; CourtNumber ← 1; Booked ←
TRUE ENDIF
IF NOT Booked AND Available2[BookTime] THEN Available2[BookTime] ← FALSE; CourtNumber
← 2; Booked ← TRUE ENDIF
IF NOT Booked AND Available3[BookTime] THEN Available3[BookTime] ← FALSE; CourtNumber
← 3; Booked ← TRUE ENDIF
IF NOT Booked AND Available4[BookTime] THEN Available4[BookTime] ← FALSE; CourtNumber
← 4; Booked ← TRUE ENDIF
IF NOT Booked AND Available5[BookTime] THEN Available5[BookTime] ← FALSE; CourtNumber
← 5; Booked ← TRUE ENDIF
IF NOT Booked AND Available6[BookTime] THEN Available6[BookTime] ← FALSE; CourtNumber
← 6; Booked ← TRUE ENDIF
IF NOT Booked AND Available7[BookTime] THEN Available7[BookTime] ← FALSE; CourtNumber
← 7; Booked ← TRUE ENDIF

© UCLES 2021 Page 5 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

1(d) IF NOT Booked AND Available8[BookTime] THEN Available8[BookTime] ← FALSE; CourtNumber


← 8; Booked ← TRUE ENDIF
IF NOT Booked OUTPUT("No court available at ", BookTime + 7)
ENDIF
IF Booked
THEN
OUTPUT ("Please enter your name")
INPUT Name
Code ← Code + 1
Correct ← "N"
WHILE Correct = "N" DO
OUTPUT ("Please enter your mobile number")
INPUT Mobile
OUTPUT ("Is Your mobile number correct Y/N? ", Mobile, " Your court number is ",
CourtNumber, " Your entry code is ", Code)
INPUT Correct
ENDWHILE
CASE CourtNumber OF
1 : Guest1[BookTime}← Name; Mobile1[BookTime] ← Mobile; Code1[BookTime] ← Code
2 : Guest2[BookTime}← Name; Mobile2[BookTime] ← Mobile; Code2[BookTime] ← Code
3 : Guest3[BookTime}← Name; Mobile3[BookTime] ← Mobile; Code3[BookTime] ← Code
4 : Guest4[BookTime}← Name; Mobile4[BookTime] ← Mobile; Code4[BookTime] ← Code
5 : Guest5[BookTime}← Name; Mobile5[BookTime] ← Mobile; Code5[BookTime] ← Code
6 : Guest6[BookTime}← Name; Mobile6[BookTime] ← Mobile; Code6[BookTime] ← Code
7 : Guest6[BookTime}← Name; Mobile7[BookTime] ← Mobile; Code7[BookTime] ← Code
8 : Guest8[BookTime}← Name; Mobile8[BookTime] ← Mobile; Code8[BookTime] ← Code
ENDCASE
NoCoutsBooked[BookTime] ← NoCoutsBooked[BookTime] - 1
ELSE
OUTPUT ("Court not booked”)
ENDIF

© UCLES 2021 Page 6 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

1(e) Explanation 4
Any four from
MP1 How the program totalled the number of bookings
MP2 How the program displayed the total number of bookings
MP3 How the program calculated the number of times each court was booked
MP4 How the program selected the highest value for times a court was booked
MP5 How the program displayed the court that was most booked

Programming statements must be included and must be explained.

© UCLES 2021 Page 7 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section B

2(a) Line 1 should be Counter ← 0 4


Line 3 RandNum[Counter] ← Rand(1, 100)should be RandNum[Counter] ← Rand(1, 101)
Line 4 Counter ← Counter + 2 should be Counter ← Counter + 1
Line 5 UNTIL Count <= 50 should be UNTIL Counter >= 50 // UNTIL Counter = 50

1 Counter ← 0
2 REPEAT
3 RandNum[Counter} ← Rand(1, 100)
4 Counter ← Counter + 1
5 UNTIL Counter >= 50
Or

Line 3 RandNum[Counter] should be RandNum[Count]


Line 3 Rand(1, 100)should be Rand(1, 101)
Line 4 Counter ← Counter + 2 should be Count ← Count + 1
Line 5 UNTIL Count <= 50 should be UNTIL Count >= 50 // UNTIL Count = 50

1 Count ← 0
2 REPEAT
3 RandNum[Count} ← Rand(1, 100)
4 Count ← Count + 1
5 UNTIL Count >= 50

2(b) One mark for each correct line 3


FOR Count ← 0 TO 49 // FOR Count ← 1 TO 50
RandNum[Count] ← Rand(1, 101) / Rand(0, 101)
NEXT // NEXT Count

2(c) Precondition loop // WHILE … DO … ENDWHILE 1

© UCLES 2021 Page 8 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

3(a)(i) one mark for sample, one mark for reason max four 4
Normal Sample any positive value with three decimal places e.g. 5.682
Reason to test that normal data is accepted and processed correctly
Erroneous Sample any value that would be rejected e.g. 5.6 or -1.345 or seven
Reason to test that erroneous data is rejected

3(a)(ii) Reason to test that 0.000 / -0.001 / highest possible non-positive is rejected and 0.001 / 0.000 / lowest positive number is 3
accepted

Sample 1 0.000
Sample 2 0.001

3(b) One mark 3


To check that values are entered as intended // to prevent incorrect values that meet the validation criteria being accepted

Two marks
Asking the user to enter the value twice and comparing the values // double entry (1) only accepting a value if both entries
are identical (1)

or

Displaying the value as it is entered (1) so the user can put right errors have been made as the value was entered (1)

© UCLES 2021 Page 9 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4 One mark for each correct column 5

Counter Distinction Mark Award OUTPUT

0 0

1 1 88

2 74

3 60

4 2 90

5 3 84

6 4 87

7 5 95

8 72

9 6 84

10 66

-1 0.6 Highly Commended

© UCLES 2021 Page 10 of 11


0478/21 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

5(a) CATEGORY – Text characters / words only used 4


PRICE – Currency, the price is in dollars / money
CODE – Text no calculations required, could be numbers or characters
STOCK – Number, comparisons and calculations may be required

5(b) One mark for correct rows Field and Table 3


One mark for correct Show row
One mark for correct Criteria row

Field: CATEGORY MANUFACTURER CODE ECONOMYRATING

Table: APPLIANCE APPLIANCE APPLIANCE APPLIANCE

Sort:

Show:    

Criteri ="A"
a:

or:

© UCLES 2021 Page 11 of 11


Cambridge IGCSE™
* 8 1 3 0 5 0 5 1 1 4 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming October/November 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages.

DC (LK/FC) 202711/3
© UCLES 2021 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.

Pre-release material

An integrated transport system has been designed to reduce the need for privately owned vehicles.
A vehicle is booked to take a passenger from home to a start station, from where they will travel to
an end station. A vehicle at the end station will take the passenger to their destination. Each stage
of the journey has a price code to represent the distance travelled. The prices for each stage are
shown:

Home to start Start station to end End station to


station station destination
Code Price ($) Code Price ($) Code Price ($)
C1 1.50 M1 5.75 F1 1.50
C2 3.00 M2 12.50 F2 3.00
C3 4.50 M3 22.25 F3 4.50
C4 6.00 M4 34.50 F4 6.00
C5 8.00 M5 45.00 F5 8.00
To book a journey, a passenger will enter a code for each stage and the start time of their journey.
The total price is calculated by adding together the price for each of the three stages. The total
price will be reduced by 40% when the start time of the journey is after 10:00.

Write and test a program or programs for the integrated transport booking system.
• Your program or programs must include appropriate prompts for the entry of data; data must
be validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.

Task 1 – setting up the booking system


Write a program to set up arrays to record the following:
• codes and prices for each of the three stages
• passenger accounts that include a unique passenger account number and name
• bookings that include a unique passenger account number, a start time of the journey, a code
for each stage of the journey, and a unique booking number for the journey.
Store the data for the code and price for each stage.

Task 2 – using the booking system


Extend Task 1 to achieve the following:
• Allow passengers to open an account by generating a unique passenger account number and
storing it along with their name in the arrays.
• Allow passengers to make a booking by first entering their unique passenger account number,
the start time of their journey, and a code for each stage of their journey. Check if the passenger
account number already exists.
• Generate a unique booking number for the journey.
• Calculate the total price of the journey, without any discount, and store the journey details.

Task 3 – applying a discount and checking the entry


Extend Task 2 to check the start time of the journey and if it is after 10:00, apply a 40% discount to
the total price.
Display the total price and booking details for the passenger to check, and allow them to either
confirm the details are correct or start again.

© UCLES 2021 0478/22/O/N/21


3

1 All variables, constants and other identifiers must have meaningful names.

(a) (i) Identify one variable you could have used for Task 2 and state its use.

Variable .............................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[2]

(ii) Describe the arrays you could have used in Task 1. Include the name, data type, use
and sample data for each array.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [5]

(b) Describe how you could validate the data entry for the input of the codes for the different
stages of the journey in Task 2.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/22/O/N/21 [Turn over


4

(c) Write an algorithm to show how your program carries out Task 3, using either pseudocode,
programming statements or a flowchart. Assume Tasks 1 and 2 have already been completed.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© UCLES 2021 0478/22/O/N/21


5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2021 0478/22/O/N/21 [Turn over


6

(d) Explain how your program could be changed to count and store the number of bookings
made by each passenger. Then, after ten bookings have been made by a passenger, apply
an additional 10% discount to every future booking. Any programming statements used in
your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]
© UCLES 2021 0478/22/O/N/21
7

Section B

2 Tick (3) one box in each row to identify if the statement is about validation, verification or neither.

Validation Verification Neither


Statement
(3) (3) (3)
a check where data is re-entered to make sure no
errors have been introduced during data entry
an automatic check to make sure the data entered
has the correct number of characters

a check to make sure the data entered is sensible

a check to make sure the data entered is correct

[3]

3 A program checks that the data entered is between 1 and 100 inclusive.

Identify one piece of normal, extreme and erroneous test data for this program, and give a reason
for each.

Normal test data ...............................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Extreme test data .............................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Erroneous test data ..........................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[6]

© UCLES 2021 0478/22/O/N/21 [Turn over


8

4 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

(a) Find the five errors in the pseudocode and suggest a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 5 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................
[5]
© UCLES 2021 0478/22/O/N/21
9

(b) The algorithm needs changing to allow only the numbers 1, 2, 3, or 4 to be entered for the
input variable Operator.

Write the pseudocode to perform this task and state where in the algorithm it would be
located.

Pseudocode ..............................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Location in algorithm ................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[5]

© UCLES 2021 0478/22/O/N/21 [Turn over


10

5 The flowchart represents an algorithm.

The algorithm will terminate if –1 is entered at the List input.

START

List1 ←0
List2 ←0
INPUT
List

Yes IS
List = –1 ?

No

INPUT
Value

IS
List = 1 ?
Yes
List1 ← List1 + Value
No

IS
List = 2 ?
Yes
List2 ← List2 + Value
OUTPUT
"List 1 = ", List1
No

OUTPUT OUTPUT
"List 2 = ", List2 "Input Error"

IS Yes
List1 > List2 ?

No
OUTPUT
"List 1 is greatest"

OUTPUT
"List 2 is greatest"

END

© UCLES 2021 0478/22/O/N/21


11

Complete the trace table for the algorithm using this input data:

2, 77, 2, 16, 1, 35, 2, –7, 5, 18, 1, 11, 1, 12, 2, 20, –1, 18

List Value List1 List2 OUTPUT

[5]

© UCLES 2021 0478/22/O/N/21 [Turn over


12

6 A pet supplier uses the database table, STOCK, to keep records of its products for pets.

The fields are:

Field name Description


ProductID code to identify the product
ProductName name of product
ProductDescription information about the product
Animal type of animal the product is for, e.g. cat, bird, horse
ProductType type of product, e.g. food, toy, medicine
InStock whether the product is in stock or not

(a) (i) Identify the field that could have a Boolean data type.

..................................................................................................................................... [1]

(ii) Identify the field that should be used as the primary key.

..................................................................................................................................... [1]

(b) Complete the query-by-example grid to output the products intended for a cat that are in
stock. Display only the primary key and the name of the products. The output should be
sorted by the primary key.

Field:

Table:

Sort:

Show:

Criteria:

or:

[4]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/22/O/N/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/22


Paper 2 October/November 2021
MARK SCHEME
Maximum Mark: 50

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 2021 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This document consists of 13 printed pages.

© UCLES 2021 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section A

1(a)(i) One mark per point 2


• Variable PassengerID// StartStage
• Use Storing the unique ID number of the passenger// Storing/inputting the start stage of the journey

1(a)(ii) One mark per point 5


MP1 Name of array
MP2 Data type of array
MP3 Sample data for array
MP4 Use of array
MP5 At least two complete arrays with all of the above

Array name Data type Sample data Use


JourneyStage1 string C1 to store the code for the home to start station
PriceStage1 real 1.50 to store the price of first stage of the journey

1(b) One mark per bullet point 3


MP1 Use of validation check, e.g. range check, type check, presence check, length check, format check
MP2 Use of conditional statement to check if the validation fails ...
MP3 … a re-entry is requested
MP4 Use of loop to repeat the process until an acceptable answer is input
MP5 More than one appropriate validation check used / described.

1(c) Any six from: 6


MP1 Conditional statement to check departure time against 10:00
MP2 … calculate 40% discount // calculate 60% of the original price
MP3 … calculate discounted total price
MP4 Output the discounted total price
MP5 Output the booking details with suitable messages
MP6 Input with prompt for passenger confirmation …
MP7 … attempt at action following the confirmation input
MP8 Repeating booking data entry if incorrect
MP9 Re-checking journey details for correctness

© UCLES 2021 Page 4 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

1(c) Example answer


// Tasks 1 and 2 completed
IF CollectedTime[Index] > 10:00
THEN
JourneyCost[Index] ← JouneyCost[Index] * 0.6
ENDIF
PRINT "Your journey cost is: ", JourneyCost[Index]
PRINT "Your journey details are: ", PassengerID[Index], JourneyTime[Index],
JourneyCodes[Index], JourneyID[Index]
PRINT "Are these details correct? (Y or N)"
INPUT Correct
IF Correct = "N"
THEN
WHILE Correct = "N"
PRINT "Re-enter your journey details"
PRINT "Correct passenger ID "
INPUT PassengerID[Index]
PRINT "Correct journey time "
INPUT JourneyTime[Index]
PRINT "Correct journey codes "
INPUT JourneyCodes[Index]
PRINT "Your revised journey details are: ", PassengerID[Index],
JourneyTime[Index], JourneyCodes[Index]
PRINT "Are these details correct? (Y or N)"
INPUT Correct
ENDWHILE
ENDIF
//Program continues

1(d) Explanation of how each of the following could be done 4


Any four from:
MP1 Declaring/using a counter to store the number of bookings for each passenger
MP2 Updating the counter for the number of bookings made by each passenger
MP3 Attempt to check the number of bookings …
MP4 … for the correct condition e.g. if the number of bookings is more than 10 / equal to 10
MP5 Apply the extra discount to the total price of future journeys

© UCLES 2021 Page 5 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section B

2 One mark for two correct rows 3


Two marks for three correct rows
Three marks for four correct rows.

Statement Validation Verification Neither


() () ()

a check where data is re-entered to make sure no errors have 


been introduced during data entry

an automatic check to make sure the data entered has the correct 
number of characters

a check to make sure the data entered is sensible 

a check to make sure the data entered is correct 

Question Answer Marks

3 One mark per bullet point 6

Normal test data


• Test data e.g. 50 (allow any number between 1 and 100 inclusive)
• Reason Data that is within range and should be accepted

Extreme test data


• Test data 100 / 1
• Reason Data at the maximum / minimum end of the range and should be accepted

Erroneous test data


• Test data e.g. 300 (allow anything that isn’t between 1 and 100 inclusive, including other data types)
• Reason Data outside the range that should be rejected

© UCLES 2021 Page 6 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4(a) One mark for error identified and suggested correction (Max three) 5

Line 8 OUTPUT Value2 – should be INPUT Value2


Line 9 IF Operator – should be CASE OF Operator
Line 15 OUTPUT "The answer is ", Value1 – should be Answer

The loop may be corrected using a number of alternative methods:

One mark for error identified and suggested correction (Max two)

Method 1
Line 1 Continue ← 1 should be Continue ← 0
Line 22 UNTIL Continue = 0 should be ENDWHILE // Line 2 WHILE Continue = 0 should be REPEAT and Line
22 UNTIL Continue = 0 should be Until Continue = 1

OR

Method 2
Line 2 WHILE Continue = 0 should be REPEAT
Line 20 Continue ← 1 should be Continue ← 0 // Line 1 Continue ← 1 should be Continue ← 0 and Line
22 UNTIL Continue = 0 should be Until Continue = 1

OR

Method 3
Line 2 WHILE Continue = 0 should be WHILE Continue = 1
Line 20 Continue ← 1 should be Continue ← 0 and Line 22 UNTIL Continue = 0 should be ENDWHILE

© UCLES 2021 Page 7 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4(a) Corrected algorithm example 1


1 Continue ← 0
2 WHILE Continue = 0 (DO)
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 INPUT Value2
9 CASE OF 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 ", Answer
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 ENDWHILE

© UCLES 2021 Page 8 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4(a) Corrected algorithm example 2


1 Continue ← 1
2 REPEAT
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 INPUT Value2
9 CASE OF 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 ", Answer
16 OUTPUT "Do you wish to enter more values (Yes or No)?"
17 INPUT MoreValues
18 IF MoreValues = "No"
19 THEN
20 Continue ← 0
21 ENDIF
22 UNTIL Continue = 0

© UCLES 2021 Page 9 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4(b) One mark per bullet 5


MP1 Appropriate loop (begin and end) / otherwise selection
MP2 Testing both ends of condition
MP3 Suitable message
MP4 Input/re-input

WHILE Operator < 1 OR Operator > 4 (DO)


OUTPUT "Enter 1, 2, 3 or 4"
INPUT Operator
ENDWHILE

Alternative answer
REPEAT
IF Operator < 1 OR Operator > 4
THEN
OUTPUT "Enter 1, 2, 3 or 4"
INPUT Operator
ENDIF
UNTIL Operator >= 1 AND Operator <= 4

One mark

After line 4 / between lines 2 and 5

© UCLES 2021 Page 10 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

5 One mark for each correct column 5

List Value List1 List2 OUTPUT

0 0

77 77

16 93

35 35

-7 86

© UCLES 2021 Page 11 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

5 List Value List1 List2 OUTPUT

18 Input Error

11 46

12 58

20 106

-1 List 1 = 58

List 2 = 106

List 2 is greatest

© UCLES 2021 Page 12 of 13


0478/22 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

6(a)(i) InStock 1

6(a)(ii) ProductID 1

6(b) One mark for correct fieldnames 4


One mark for correct table names and show fields
One mark for correct sort
One mark for correct search criteria in all columns

Field: ProductID ProductName Animal InStock

Table: STOCK STOCK STOCK STOCK

Sort: Ascending

Show:     

Criteria: =“cat” =Yes

or:

© UCLES 2021 Page 13 of 13


Cambridge IGCSE™
* 4 6 5 7 1 8 1 0 8 7 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming October/November 2021

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 16 pages. Any blank pages are indicated.

DC (CJ/SG) 202718/4
© UCLES 2021 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.

Pre-release material

A cruise ship has a speciality restaurant where tables can be booked for any of the three sessions:
lunch, early dinner or late dinner. A booking for a table can only be made on the day. There are
twenty tables available to book in the restaurant. Today’s date and how many tables are available for
lunch, early dinner and late dinner are displayed on a screen at the entrance to the restaurant.
Only one table can be booked at a time. When a booking is made, the name of the passenger making
the booking is recorded, together with their cabin number and any special dietary requirements.
Write and test a program or programs for a computer system to manage the daily restaurant bookings.
• Your program or programs must include appropriate prompts for the entry of data; data must be
validated on entry.
• Error messages and other output need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.

Task 1 – at the start of the day


Write a program to set up the screen display at the start of the day showing the date and how many
tables are available for lunch, early dinner and late dinner. Bookings are to be stored in three separate
arrays: lunch, early dinner and late dinner. Initialise further arrays to record for each table booked: the
name of the passenger making the booking, their cabin number and any special dietary requirements.

Task 2 – making a table booking at the restaurant


Check if there is a table available for the session requested. If a table is available, record the
passenger’s name, cabin number and any special dietary requirements. Mark the table as booked
for that session. Display the name and cabin number for the passenger to check. Update the screen
display and mark a session as fully booked if all the tables are now booked.

Task 3 – special dietary requirements


The recording of special dietary requirements is confusing the restaurant staff. It has been decided
to use fixed options instead of a description. Only one option can be chosen for each booking.
The options are:
• gluten-free
• vegetarian
• vegan
• diabetic
• none.
Update Task 2 to allow for this.
Update Task 2 to count and display how many tables have vegetarian or vegan diners during the
day.
© UCLES 2021 0478/23/O/N/21
3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify one constant that you could have used for Task 1. Give the value that would be
assigned to this constant. State the use of this constant.

Constant ...................................................................................................................................

Value .........................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................
[3]

(b) Describe the arrays that you have set up in Task 1 to record today’s data about the restaurant
tables.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2021 0478/23/O/N/21 [Turn over


4

(c) Sometimes the restaurant has fewer tables available for a session.

Explain how you would change your Task 1 program to allow input of the number of tables
available for a session.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(d) Part of Task 2 is to check if a table is available. Write an algorithm to do this, using either
pseudocode, programming statements or a flowchart. Assume that Task 1 has been
completed.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2021 0478/23/O/N/21
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2021 0478/23/O/N/21 [Turn over


6

(e) Explain how your program for Task 3 updated Task 2.

Include any programming statements used and fully explain the purpose of each statement.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2021 0478/23/O/N/21


7

Section B starts on Page 8.

© UCLES 2021 0478/23/O/N/21 [Turn over


8

Section B

2 An algorithm has been written in pseudocode to generate 50 positive random integers with values
less than or equal to 100. These numbers are stored in the array NumRand[]

The function RandUp(X,Y) generates a random integer greater than X and less than or equal to Y
For example, RandUp(1,4) generates 2 or 3 or 4

1 Count 0
2 WHILE Counter > 50 DO
3 NumRand[Counter] RandUp(1,100)
4 Counter Counter − 2
5 ENDWHILE

(a) Find the four errors in the pseudocode and write a correction for each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

Error 4 .......................................................................................................................................

Correction .................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

(b) The pseudocode for this algorithm could be shortened by the use of a FOR … NEXT loop.

Rewrite the algorithm using a FOR … NEXT loop.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2021 0478/23/O/N/21


9

3 A program has been written to check the length and content of a password. The password must be
eight or more characters long and contain at least one special character, for example, Secret!*!

(a) (i) State suitable examples of normal and erroneous test data that could be used to test this
program. For each example give the reason for your choice of test data.

Normal test data example .................................................................................................

Reason ..............................................................................................................................

...........................................................................................................................................

Erroneous test data example ............................................................................................

Reason ..............................................................................................................................

...........................................................................................................................................
[4]

(ii) Explain why two pieces of boundary test data are required for this program.
Give an example of each piece of boundary test data.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [3]

(b) Describe two methods of verification that could be used to verify this data as it is input.

Method 1 ...................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

Method 2 ...................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2021 0478/23/O/N/21 [Turn over


10

4 The algorithm, shown by this flowchart, allows the input of examination marks for a class of
students. A mark of 999 ends the process. If a mark is 40 or over then a pass grade is awarded.
The number of pass grades is calculated for the whole class. If this is under 50% of the class, the
class is offered extra help.

START

Counter 0
Pass 0

INPUT
Mark

IS Yes
Mark = 999 ? Help Pass / Counter

No
IS Yes
Counter Counter + 1 OUTPUT
Help < 0.5 ? "Extra Help"

No
Yes IS
Pass Pass + 1 Mark >= 40 ?
END
No

© UCLES 2021 0478/23/O/N/21


11

Complete a trace table for the algorithm using this input data:
88, 24, 60, 30, 44, 17, 25, 22, 54, 6, 999, −1

Counter Pass Mark Help OUTPUT

[5]

© UCLES 2021 0478/23/O/N/21 [Turn over


12

5 A database table, COMPUTER, is used to keep a record of computers available for sale.

The following data is stored for each computer:

• CATEGORY – desktop, laptop or tablet


• WEIGHT – weight in kilograms
• MANUFACTURER – ICN, Linoldo, Pear or JoeSing
• PRICE – price in $
• CODE – a unique code allocated by the manufacturer, e.g. P771
• STOCK – quantity in stock.

A database management system uses these data types:

Text Number Currency Boolean

The CATEGORY field and MANUFACTURER field have a data type of text.

(a) Select the most appropriate data type for each field from the four types shown. State the
reason why you chose the data type.

WEIGHT data type ....................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

PRICE data type .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

CODE data type .......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

STOCK data type ......................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[4]

© UCLES 2021 0478/23/O/N/21


13

(b) Complete the query-by-example grid to display only the category, manufacturer, price and
code of the computers with weight of less than 2.5 kilograms.

Field:

Table:

Sort:

Show:

Criteria:

or:
[3]

© UCLES 2021 0478/23/O/N/21


14

BLANK PAGE

© UCLES 2021 0478/23/O/N/21


15

BLANK PAGE

© UCLES 2021 0478/23/O/N/21


16

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2021 0478/23/O/N/21


Cambridge IGCSE™

COMPUTER SCIENCE 0478/23


Paper 2 October/November 2021
MARK SCHEME
Maximum Mark: 50

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 2021 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This document consists of 9 printed pages.

© UCLES 2021 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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 descriptors 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.

© UCLES 2021 Page 2 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
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.

© UCLES 2021 Page 3 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section A

1(a) Constant name MaxNoTables 3


Value 20
Use Storing the maximum number of tables available for a session

1(b) Any three from: 4


MP1 Identifier / name of array used
MP2 Description of purpose of an identified array
MP3 Length of an identified array used
MP4 Type of data in an identified array
MP5 Explanation of number of arrays used, must be capable of storing all data required
MP6 Sample data for an identified array

One mark
MP7 Identifying more than one array

E.g. 3 sets of 4 arrays of twenty elements for each session, for example for lunch, TableLunch of type Boolean,
PassengerLunch, CabinLunch and DietReqLunch all type string

1(c) Any three from: 3


MP1 Input the maximum number of tables available for a session
MP2 Input the maximum number of tables available for every session
MP3 Storing each value input in a variable / an array
MP4 Validation check
MP5 Change the constant used for number of tables to a variable
MP6 Using the value input instead of 20 for max value for loop counter etc

© UCLES 2021 Page 4 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

1(d) Any six from: 6


MP1 Input session
MP2 … with prompt
MP3 Validate input
MP4 Check number of tables available / check each table …
MP5 … for the session that has been input
MP6 If no tables available any session that has been input
MP7 … output suitable message

Sample
REPEAT
OUTPUT "Which session do you want to book a table?"
INPUT Session
UNTIL Session >= 1 AND Session <= 3
IF TablesAvailable[Session] = 0
THEN
OUTPUT "No tables available "
ENDIF

1(e) Explanation 4
Any four from:
MP1 Any changes required for the Array data types in Task 1
MP2 How the program displayed the options in Task 3
MP3 How the program selected the choice in Task 3
MP4 How the program dealt with incorrect choices in Task 3
MP5 How the program counted number of tables with vegetarian diners
MP6 How the program counted number of tables with vegan diners
MP7 How the program output number of tables with vegetarian/vegan diners

Programming statements should be used and must be explained.

© UCLES 2021 Page 5 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

Section B

2(a) Line 1 should be Counter 4


Line 2 should be < 50
Line 3 should be RandUp(0,100) // RandUp(-1,100)
Line 4 should be Counter ← Counter + 1
1 Counter ← 0
2 WHILE Counter < 50 DO
3 NumRand[Counter} ← RandUp(0, 100)
4 Counter ← Counter + 1
5 ENDWHILE

2(b) Any three from: 3


FOR Counter ← 0 TO 49 // FOR Counter ← 1 TO 50
NumRand[Counter] ← RandUp(0,100) / RandUp(-1,100)
NEXT // NEXT Counter

Question Answer Marks

3(a)(i) one mark for sample, one mark for reason max four 4
Normal Sample any password with at least 8 characters and one special character e.g. Password!
Reason to test that normal data is accepted and processed correctly

Erroneous Sample any value that would be rejected e.g. secret


Reason to test that erroneous data is rejected

3(a)(ii) Reason to test that Secret? which has 7 characters is rejected and Secret?? which has 8 characters is accepted 3

Boundary Sample 1 – Secret?


Boundary Sample 2 – Secret??

© UCLES 2021 Page 6 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

3(b) Any two methods, one mark for method, one mark for description max four 4
E.g.
Asking the user to enter the password twice and comparing the values (1) only accepting the data if both entries are
identical (1)
Displaying the password as it is entered (1) so the user can put right errors have been made as the password was typed (1)

© UCLES 2021 Page 7 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

4 One mark for each correct column 5

Counter Pass Mark Help OUTPUT

0 0

1 1 88

2 24

3 2 60

4 30

5 3 44

6 17

7 25

8 22

9 4 54

10 6

999 0.4 Extra Help

Question Answer Marks

5(a) WEIGHT – Number, comparisons / calculations may be required 4


PRICE – Currency, the price is in dollars / money
CODE – Text, no calculations required, could be numbers or characters
STOCK – Number, comparisons / calculations may be required

© UCLES 2021 Page 8 of 9


0478/23 Cambridge IGCSE – Mark Scheme October/November 2021
PUBLISHED
Question Answer Marks

5(b) 3
Field: CATEGORY MANUFACTURER PRICE CODE WEIGHT

Table: COMPUTER COMPUTER COMPUTER COMPUTER COMPUTER

Sort:

Show:     

Criteria: < 2.5

or:

One mark for correct rows Field and Table


One mark for correct Show row
One mark for correct Criteria row

© UCLES 2021 Page 9 of 9


Cambridge IGCSE™
* 3 0 6 2 8 7 9 6 9 6 *

COMPUTER SCIENCE 0478/21


Paper 2 Problem-solving and Programming May/June 2022

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages.

DC (KN) 303743/3
© UCLES 2022 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.

Pre-release material

Friends of Seaview Pier is an organisation devoted to the restoration and upkeep of a pier in the
town. A pier is a wooden structure that provides a walkway over the sea. The pier requires regular
maintenance and the friends of the pier need to raise money for this purpose.
Members of Friends of Seaview Pier each pay $75 per year, as a contribution to the pier’s running costs.
This entitles them to free admission to the pier throughout the year. They can also volunteer to help run
the pier, by working at the pier entrance gate, working in the gift shop, or painting and decorating.
To provide additional income, the pier’s wooden planks can be sponsored. A brass plaque, which
contains a short message of the sponsor’s choice, is fitted to a plank on the pier, for a donation of
$200.
Write and test a program or programs for the Friends of Seaview Pier:
• Your program or programs must include appropriate prompts for the entry of data. Data must be
validated on entry.
• All outputs, including error messages, need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – becoming a member of Friends of Seaview Pier
Set up a system to enable people to become members of Friends of Seaview Pier and for each new
member enter:
• their first name and last name
• whether or not they wish to work as a volunteer
○ if they choose to volunteer, identify the area from:
– the pier entrance gate
– the gift shop
– painting and decorating
• the date of joining
• whether or not they have paid the $75 fee.
All of this information needs to be stored using suitable data structures.
Task 2 – using the membership data
Extend the program in Task 1 so that a list of the first and last names of members can be output in
any of the following categories:
• Members who have chosen to work as volunteers.
• Volunteers who would like to work at the pier entrance gate.
• Volunteers who would like to work in the gift shop.
• Volunteers who would like to help with painting and decorating tasks.
• Members whose membership has expired (they have not re-joined this year).
• Members who have not yet paid their $75 fee.
Task 3 – sponsoring a wooden plank
Add an additional option to the program in Task 1 to enable the pier’s wooden planks to be
sponsored. Separate data structures should be used to store the names of the individuals and
the short messages they would like to have written on their brass plaque. An output would display
everything that was input for the sponsor to confirm. If errors are found, the program should allow
data to be re-entered. Once complete, the data is stored and the sponsor is charged $200.

© UCLES 2022 0478/21/M/J/22


3

1 (a) Describe the data structures you could have used in Task 1. Your description should include
types of data structure, names used for data structures, their uses and examples of sample
data.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]

(b) Explain how you could change your program in Task 1 to total all the money collected from
new members who have paid.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Describe how data input in Task 1 could be validated to find out if a new member wants to
work as a volunteer.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2022 0478/21/M/J/22 [Turn over


4

(d) Write an algorithm to show how your program completes Task 3 assuming the option to
sponsor a wooden plank has been chosen, using pseudocode, programming statements or a
flowchart. Details completed in Task 1 are not required.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© UCLES 2022 0478/21/M/J/22


5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [5]
© UCLES 2022 0478/21/M/J/22 [Turn over
6

(e) Explain how your program allows any one of the member or volunteer lists to be selected and
displayed (part of Task 2). Any programming statements used in your answer must be fully
explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2022 0478/21/M/J/22


7

Section B

2 Tick (ü) one box in each row to identify the most appropriate data type for each description. Only
one tick (ü) per column.

Data type
Description
Boolean Char Integer Real String
a single character from the keyboard

multiple characters from the keyboard

only one of two possible values

only whole numbers

any number
[4]

3 Give one piece of normal test data and one piece of erroneous test data that could be used to
validate the input of an email address.

State the reason for your choice in each case.

Normal test data ...............................................................................................................................

..........................................................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Erroneous test data ..........................................................................................................................

..........................................................................................................................................................

Reason .............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2022 0478/21/M/J/22 [Turn over


8

4 The flowchart shows an algorithm that should allow 60 test results to be entered into the variable
Score. Each test result is checked to see if it is 50 or more. If it is, the test result is assigned to the
Pass array. Otherwise, it is assigned to the Fail array.

(a) Complete this flowchart:

START

PassCount 0

FailCount 0

Count 0

Yes No

Count Count + 1

No

Yes

END

[6]
© UCLES 2022 0478/21/M/J/22
9

(b) Write a pseudocode routine that will check that each test result entered into the algorithm is
between 0 and 100 inclusive.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2022 0478/21/M/J/22 [Turn over


10

5 The pseudocode represents an algorithm.

The pre-defined function DIV gives the value of the result of integer division.
For example, Y = 9 DIV 4 gives the value Y = 2

The pre-defined function MOD gives the value of the remainder of integer division.
For example, R = 9 MOD 4 gives the value R = 1

First ← 0
Last ←
0
INPUT Limit
FOR Counter ← 1 TO Limit
INPUT Value
IF Value >= 100
THEN
IF Value < 1000
THEN
First ← Value DIV 100
Last ←Value MOD 10
IF First = Last
THEN
OUTPUT Value
ENDIF
ENDIF
ENDIF
NEXT Counter

(a) Complete the trace table for the algorithm using this input data:

8, 66, 606, 6226, 8448, 642, 747, 77, 121

Counter Value First Last Limit OUTPUT

[5]

© UCLES 2022 0478/21/M/J/22


11

(b) Describe the purpose of the algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2022 0478/21/M/J/22 [Turn over


12

6 A computer game shop records its stock levels in a database table called GAMES. The fields used
in the stock table are shown.

Name Description
GameID primary key
GameName the name of each game
AgeRestriction the minimum age at which a person is allowed to play each game
GamePrice the selling price for each game
NumberStock the quantity of each game currently in stock
OnOrder whether or not each game is on order from the suppliers
DateLastOrdered the date the most recent order for each game was placed
GameDescription a summary of the contents and purpose of each game

(a) State the number of fields that are in the table GAMES.

............................................................................................................................................. [1]

(b) State one important fact that must be true for a field to be a primary key.

...................................................................................................................................................

............................................................................................................................................. [1]

(c) Complete the query-by-example grid to output all the games that have no stock and that are
on order with the supplier. Display only the GameID, GameName and GamePrice fields in
alphabetical order of the name of the game.

Field:

Table:

Sort:

Show:

Criteria:

or:
[3]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2022 0478/21/M/J/22


Cambridge IGCSE™

COMPUTER SCIENCE 0478/21


Paper 2 Problem Solving and Programming May/June 2022
MARK SCHEME
Maximum Mark: 50

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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 13 printed pages.

© UCLES 2022 [Turn over


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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 descriptors 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.

© UCLES 2022 Page 2 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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.

© UCLES 2022 Page 3 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to
be the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a mark point has an ellipsis at the beginning, but there is no ellipsis on the mark point before it, then this is just a follow-on
sentence and can be awarded without the previous mark point.

© UCLES 2022 Page 4 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

Section A

1(a) One mark per mark point, max five 5

Data Structure(s), max two


MP1 arrays
MP2 variable(s) / constant(s)
Further description, max three
MP3 name(s) one or more
MP4 sample data for appropriate arrays or variables
MP5 use(s) one or more
Additional data structure description using the same data structure type, max one
MP6 two or more full descriptions of the data structure including name, sample data and use

For example:
An array (1) named FirstName (1) to store the first names of the members (1) such as James (1). A variable (1) could also
be used to enter whether or not they wish to volunteer. (5 marks)

A variable (1) named FirstName (1) to input the first names of the members (1) such as James (1). A variable could also be
used to enter whether or not they wish to volunteer, with sample data of ‘yes’ (1). (5 marks)

Task 1 – becoming a member of Friends of Seaview Pier


Set up a system to enable people to become members of Friends of Seaview Pier and for each new member enter:
 their first name and last name
 whether or not they wish to work as a volunteer
– if they choose to volunteer, identify the area from:
o the pier entrance gate
o the gift shop
o painting and decorating
 the date of joining
 whether or not they have paid the $75 fee.
All of this information needs to be stored using suitable data structures.

© UCLES 2022 Page 5 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(b) Explanation of how each was done. Code is allowed, but must be fully explained. 3

One mark per mark point, max three

MP1 add/use a (new) variable/array to total the membership fee money // total number of members who have paid
MP2 initialise the totalling variable to 0 at the start of the program
MP3 check whether the new member has paid the $75 fee using a conditional statement
MP4 …if they have paid, and the amount paid is being totalled, add 75 to the current running total of the membership
fee total
MP5 …if they have paid, and the number of paid members is being totalled, add 1 to the total number of members who
have paid
MP6 …if they have paid, and the number of paid members is being totalled, multiply total by 75, to give total paid.

1(c) Any code must include a description of what it is for. 3

One mark per mark point, max three


Max two for just naming different appropriate validation checks

MP1 apply a presence check // to ensure that data has been entered (to the question do you want to work as a
volunteer?)
MP2 apply a type check // to ensure that data has been entered of the correct data type e.g. integer if the response
required is 1 or 0
MP3 checking the valid inputs would be either yes or no // apply a check to ensure that the data matches the expected
input
MP4 the valid inputs would be to choose in which area the new member wishes to volunteer e.g. a list of areas
MP5 if input is not valid, an error message is output (and a new input is requested)
MP6 if input is valid, the program continues

© UCLES 2022 Page 6 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) One mark per mark point, max five 5


MP1 input for sponsor’s name / name taken from previous data // input for message on plaque
MP2 both inputs correct with appropriate prompts // input for message on plaque correct with appropriate prompt and
name taken from previous data
MP3 output of input(s) for confirmation …
MP4 … method for sponsor to confirm that the input(s) are correct
MP5 method to enable re-entry of message on plaque if errors made
MP6 charge of $200 acknowledged / charged / confirmed / displayed
MP7 (name and) message stored in arrays
MP8 array index incremented for next sponsor

Task 3 – sponsoring a wooden plank


Add an additional option to the program in Task 1 to enable the pier’s wooden planks to be sponsored. Separate data
structures should be used to store the names of the individuals and the short messages they would like to have written on
their brass plaque. An output would display everything that was input for the sponsor to confirm. If errors are found, the
program should allow data to be re-entered. Once complete, the data is stored and the sponsor is charged $200.

Example answer
ArrayIndex  0 //initial array's index
Check  "N"
WHILE Check <> "Y"
OUTPUT "Enter your name"
INPUT Name
OUTPUT "Enter the message you would like on your brass plaque"
INPUT Message
OUTPUT "The data you have entered is, name: ", Name, " and your
message for the plaque is: ", Message
OUTPUT "Is this correct (Y or N)"
INPUT Check
IF Check <> "Y"
THEN
OUTPUT "The data entered is incorrect, please re-enter"
ENDIF
ENDWHILE

© UCLES 2022 Page 7 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) PlankName[ArrayIndex]  Name


Message[ArrayIndex]  Message
ArrayIndex  ArrayIndex + 1
OUTPUT "The fee for this service is $200"
//some method of paying the fee or acknowledgement of the fee

1(e) Explanation of how each was done. Code is allowed, but must be fully explained. 4

One mark per mark point, max four

MP1 a menu is provided/options are displayed so that the user can choose which of the lists they wish to see
MP2 the user inputs a number/code as shown on the menu corresponding to their menu choice
MP3 attempt to validate input
MP4 … if it does not match an option, give an error message and ask for re-input
MP5 … if it matches an option, a range of IF statements/conditional statements/CASE statement are/is used to
compare the input with the available options
MP6 … output the chosen list e.g. using a loop to output the contents of the appropriate first and second name arrays
corresponding to the user input
MP7 identification of empty list and appropriate action

Task 2 – using the membership data


Extend the program in Task 1 so that a list of the first and last names of members can be output in any of the following
categories:
 Members who have chosen to work as volunteers.
 Volunteers who would like to work at the pier entrance gate.
 Volunteers who would like to work in the gift shop.
 Volunteers who would like to help with painting and decorating tasks.
 Members whose membership has expired (they have not re-joined this year).
 Members who have not yet paid their $75 fee.

© UCLES 2022 Page 8 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

Section B

2 Four marks for five correct rows 4


Three marks for four correct rows
Two marks for three correct rows
One marks for two correct rows

Data type
Description
Boolean Char Integer Real String

a single character from the keyboard 

multiple characters from the keyboard 

only one of two possible values 

only whole numbers 

any number 

Question Answer Marks

3 One mark per mark point, max four 4

 Normal test data computerscience@[Link]


 Reason this is a valid email address (containing the @ symbol) and should be accepted

 Erroneous test data computerscienceisgreat


 Reason this is just a string, and should be rejected (as an email address needs a single ’@’)

© UCLES 2022 Page 9 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

4(a) One mark per mark point, max six 6

MP1 input box


MP2 correct check of Score
MP3 assign Score to Pass correctly
MP4 assign Score to Fail correctly
MP5 increment both array counters
MP6 correct check of number of scores

START

PassCount  0

FailCount  0

Count  0

INPUT
Score

Yes IS Score >= No


50?

Pass[PassCount]  Score Fail[FailCount]  Score

PassCount  PassCount + 1 FailCount  FailCount + 1

Count  Count + 1

No IS Count =
60?

Yes
END

© UCLES 2022 Page 10 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

4(b) One mark per mark point, max four 4

MP1 appropriate conditional loop structure


MP2 correct identification of invalid input
MP3 appropriate error message
MP4 repeated input of score until correct

WHILE Score < 0 OR Score > 100 (DO)


OUTPUT "Your entry must be between 0 and 100, inclusive, please try again "
INPUT Score
ENDWHILE

Or:

REPEAT
IF Score < 0 OR Score > 100
THEN
OUTPUT "Your entry must be between 0 and 100, inclusive, please try again "
INPUT Score
ENDIF
UNTIL Score >= 0 AND Score <= 100

© UCLES 2022 Page 11 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

5(a) One mark per mark point, max five 5

MP1 correct Counter and Limit columns


MP2 correct Value column
MP3 correct First column
MP4 correct Last column
MP5 correct OUTPUT

Counter Value First Last Limit OUTPUT

0 0 8

1 66

2 606 6 6 606

3 6226

4 8448

5 642 6 2

6 747 7 7 747

7 77

8 121 1 1 121

© UCLES 2022 Page 12 of 13


0478/21 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

5(b) One mark per mark point, max two 2


 checks for / outputs 3-digit numbers
 … where the first and last digit are the same

Question Answer Marks

6(a) 8 1

6(b) The primary key field must be unique/different for each record in the table 1

6(c) One mark per mark point, max three 3

 correct fields and table named correctly


 correct sort and show box rows
 correct search criteria

Field: GameID GameName GamePrice NumberStock OnOrder

Table: GAMES GAMES GAMES GAMES GAMES

Sort: Ascending

Show:     

Criteria: =0 ="Y"

or:

© UCLES 2022 Page 13 of 13


Cambridge IGCSE™
* 6 5 6 8 1 1 8 8 5 0 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming May/June 2022

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages.

DC (PQ) 303914/4
© UCLES 2022 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.

Here is a copy of the pre-release material.

DO NOT attempt Tasks 1, 2 and 3 now.

Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.

Pre-release material
A program is needed to allow a Wildlife Park to sell tickets. A booking consists of one or more tickets for
the same day(s) and can be made up to a week in advance. A booking can be made for a visit of one day
or two consecutive days. A booking can have extra attractions included. A booking will be valid for the
day(s) chosen only.

Ticket type Cost for one day Cost for two days
one adult $20.00 $30.00
one child (an adult may bring up to two children) $12.00 $18.00
one senior $16.00 $24.00
family ticket (up to two adults or seniors, and three children) $60.00 $90.00
groups of six people or more, price per person $15.00 $22.50

Extra attraction Cost per person


lion feeding $2.50
penguin feeding $2.00
evening barbecue (two-day tickets only) $5.00

Write and test a program or programs for the Wildlife Park:


• Your program or programs must include appropriate prompts for the entry of data. Data must be
validated on entry.
• All outputs, including error messages, need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – displaying the ticket options and the extra attractions available
Set up your program to:
• display the options, attractions and prices for one-day tickets
• display the options, attractions and prices for two-day tickets
• show the days available for booking; assume that there are tickets available for any valid day.

Task 2 – process a booking


Extend your program for Task 1 to:
• input the tickets and extra attractions required, then calculate the total cost of the booking
• allocate a unique booking number
• display the booking details, including the total cost and the unique booking number
• repeat as required.

Task 3 – ensuring each booking is the best value


Check that the total for each booking gives the best value and offer an alternative if this is not the case.
For example, buying two family tickets is better than a group ticket for a group of 10 that includes
four adults and six children.
© UCLES 2022 0478/22/M/J/22
3

1 All variables, constants and other identifiers must have meaningful names.

(a) (i) Identify one constant that you could have used for Task 1.
Give the value and use of the constant.

Constant ............................................................................................................................

Value .................................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................
[3]

(ii) Identify one variable that you could have used for Task 2.
Give the data type and use of the variable.

Variable .............................................................................................................................

Data type ...........................................................................................................................

Use ....................................................................................................................................

...........................................................................................................................................
[3]

(b) Explain how your program showed the days available for booking in Task 1.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(c) Explain how your program made sure that each booking number allocated in Task 2 was
unique.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2022 0478/22/M/J/22 [Turn over


4

(d) Write an algorithm for the part of Task 2 that inputs the tickets and extra attractions required
then calculates the total cost of the booking.

Assume that the booking is for a single day.

Use pseudocode, programming statements or a flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2022 0478/22/M/J/22
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]

© UCLES 2022 0478/22/M/J/22 [Turn over


6

(e) Explain how your program decides when a family ticket is better value in Task 3.

Any programming statements that you include in your answer must be fully explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2022 0478/22/M/J/22


7

Section B starts on page 8

© UCLES 2022 0478/22/M/J/22 [Turn over


8

Section B

2 An algorithm allows a user to input their password and checks that there are at least eight
characters in the password. Then, the user is asked to re-input the password to check that both
inputs are the same. The user is allowed three attempts at inputting a password of the correct
length and a matching pair of passwords. The pre-defined function LEN(X) returns the number of
characters in the string, X

01 Attempt 0 ←
02 REPEAT
03 PassCheck TRUE ←
04 OUTPUT "Please enter your password "
05 INPUT Password
06 IF LEN(Password) < 8
07 THEN
08 PassCheck TRUE ←
09 ELSE
10 OUTPUT "Please re-enter your password "
11 INPUT Password2
12 IF Password <> Password
13 THEN
14 PassCheck FALSE ←
15 ENDIF
16 ENDIF
17 Attempt ←
Attempt + 1
18 UNTIL PassCheck OR Attempt <> 3
19 IF PassCheck
20 THEN
21 OUTPUT "Password success"
22 ELSE
23 OUTPUT "Password fail"
24 ENDIF

(a) Identify the three errors in the pseudocode and suggest a correction to remove each error.

Error 1 .......................................................................................................................................

Correction .................................................................................................................................

Error 2 .......................................................................................................................................

Correction .................................................................................................................................

Error 3 .......................................................................................................................................

Correction .................................................................................................................................
[3]

© UCLES 2022 0478/22/M/J/22


9

(b) The algorithm includes two types of check on the data input.
Identify and describe each type of check.

Type of check 1 ........................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................

Type of check 2 ........................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................
[4]

(c) Give two sets of test data for this algorithm and a reason for choosing each set.

Each set of test data and its reason must be different.

Set 1 .........................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................

Set 2 .........................................................................................................................................

Reason .....................................................................................................................................

...................................................................................................................................................
[4]

3 (a) Describe a one-dimensional array. Include an example of an array declaration.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

(b) Explain how indexing could be used to search for a value stored in a one-dimensional array.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2022 0478/22/M/J/22 [Turn over


10

4 This algorithm checks the temperature of hot food being served to customers.
Error

START

Counter 0
Hot 0
Cold 0
Serve 0

INPUT Temp

Is Temp Yes Error


= –1? ((Hot + Cold) / Counter) * 100

No

Is Temp Yes OUTPUT


Hot Hot + 1
> 86? "Too Hot"

Counter No
Counter + 1 OUTPUT
Error
Is Temp Yes
Cold Cold + 1
< 63?
No
OUTPUT
Serve Serve + 1 "Too Cold"
END

© UCLES 2022 0478/22/M/J/22


11

(a) Complete the trace table for the algorithm using this input data:

75, 78, 84, 87, 91, 80, 75, 70, 65, 62, –1, 20

Counter Hot Cold Serve Temp Error OUTPUT

[7]

(b) State how the final output from the algorithm could be improved.

...................................................................................................................................................

............................................................................................................................................. [1]

(c) Identify the process in the algorithm that is not required.

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2022 0478/22/M/J/22 [Turn over


12

5 A database table, NURSE, is used to keep a record of disposable items worn by veterinary nurses.

This is part of the table:

ItemNumber Description SingleUse Uses StockLevel ReorderLevel

DIG1 Glove (pair) Y 1 500 800

DIA1 Apron Y 1 700 800

DIM5 Hair net Y 1 650 500

DIA2 Apron N 5 25 100

DIS4 Suit N 3 70 50

DIV9 Shoe cover (pair) Y 1 400 250

(a) Complete this query-by-example grid to display only the item number and the description of
single use items, where the stock level is below the reorder level.

Field:

Table:

Sort:

Show:

Criteria:

or:
[4]

(b) Give a reason why the field SingleUse is not required in the table NURSE.

...................................................................................................................................................

............................................................................................................................................. [1]

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2022 0478/22/M/J/22


Cambridge IGCSE™

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming May/June 2022
MARK SCHEME
Maximum Mark: 50

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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 12 printed pages.

© UCLES 2022 [Turn over


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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 descriptors 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.

© UCLES 2022 Page 2 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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.

© UCLES 2022 Page 3 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to
be the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a mark point has an ellipsis at the beginning, but there is no ellipsis on the mark point before it, then this is just a follow-on
sentence and can be awarded without the previous mark point.

© UCLES 2022 Page 4 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED

Question Answer Marks

Section A

1(a)(i) Many correct answers, the name used must be meaningful. The name given is an example only. 3
One mark per mark point, max three
Constant AdultCostOneDay
Value 20.00
Use Storing the cost of an adult ticket for one day

1(a)(ii) Many correct answers, the name used must be meaningful. The name given is an example only. 3
One mark per mark point, max three
Variable NumberOfTickets // NumberOfAdultTickets
Data type Integer
Use Inputting the number of tickets purchased // Inputting the number of adult tickets purchased

1(b) One mark per mark point, max three 3

MP1 using an array or variables // lookup // input today’s date


MP2 use a loop / FOR / REPEAT / WHILE statement
MP3 … to output / display today’s date / today using a suitable message
MP4 … and the 6/7 following dates/days // loop 6/7 times

or

MP5 using an array or variables // lookup // input today’s date


MP6 array/ variables contains all the days of the week / the next seven days or dates
MP7 attempt to output / display available days using a suitable message(s)

1(c) One mark per mark point, max two 2


MP1 method used to allocate a new number, e.g. initialise a variable or counter // select a random number
MP2 how it ensured uniqueness, e.g. every booking number is one larger than the previous number
// check existing bookings to ensure it hasn’t been used before

© UCLES 2022 Page 5 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) One mark per mark point, max six 6

MP1 initialise a running total for the cost of the booking


MP2 input (with prompt) the number of tickets
MP3 … attempt to identify type of ticket
MP4 … add the cost of tickets to the running total
MP5 ability to book several types of ticket
MP6 attempt to check that the number of children booked is less than or equal to twice the number of adults
MP7 attempt to identify type of attraction
MP8 input with prompt the number of selected attractions required
MP9 … check that this number is not greater than the total number of tickets booked
MP10 … add the cost of the attractions to the (running) total

Example answer
TotalCost  0
TotalPeople  0
OUTPUT "Do you want single tickets? Y/N"
INPUT Single
IF Single = "Y"
THEN
FOR Type  1 TO 3 // adults, children and seniors
REPEAT
Flag  True
OUTPUT "How many ",TicketDecription[Type], " tickets"
INPUT NumberOfTickets[Type]
IF Type = 2
THEN
IF NumberOfTickets[2] > 2 * NumberOfTickets[1]
THEN
Flag  FALSE
OUTPUT "Too many children"
ENDIF
ENDIF
UNTIL NumberOfTickets[Type] >= 0 AND Flag
TotalCost  TotalCost + TicketPrice[Type] * NumberOfTickets[Type]

© UCLES 2022 Page 6 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) TotalPeople  TotalPeople + NumberOfTickets[Type]


NEXT Type
ENDIF
OUTPUT "Do you want a family ticket? Y/N"
INPUT Family
IF Family = "Y"
THEN
OUTPUT "How many?"
INPUT NumberOfTickets[4]
TotalCost  TotalCost + TicketPrice[4] * NumberOfTickets[4]
TotalPeople  TotalPeople + NumberOfTickets[4] * 5
ENDIF

OUTPUT "Do you want a group ticket? Y/N"


INPUT Group
IF Group = "Y"
THEN
OUTPUT "How many people in the group?"
INPUT NumberOfTickets[5]
TotalCost  TotalCost + TicketPrice[5] * NumberOfTickets[5]
TotalPeople  TotalPeople + NumberOfTickets[5]
ENDIF

REPEAT
OUTPUT "How many people would like to see the lion feeding?"
INPUT LionFeedingNumber
IF TotalPeople >= LionFeedingNumber
THEN TotalCost  TotalCost + LionFeedingNumber * LionfeedingPrice
ENDIF
OUTUT "How many people would like to see the penguin feeding?"
INPUT PenguinFeedingNumber
IF TotalPeople >= PenguinFeedingNumber
THEN TotalCost  TotalCost + PenguinFeedingNumber * PenguinfeedingPrice
ENDIF
UNTIL TotalPeople >= PenguinFeedingNumber AND TotalPeople >= LionFeedingNumber

© UCLES 2022 Page 7 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(e) Explanation 3
One mark per mark point, max three
MP1 use of selection (or any other method) to identify bookings with 2 or more adults and/or seniors and 2 (allow 3) or
more children
MP2 calculating new price including family ticket(s) for booking / tickets sold
MP3 … use of condition to compare price of family ticket(s) to price of ordinary tickets / group ticket(s) …
MP4 … identifying best value / lowest cost

© UCLES 2022 Page 8 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

Section B

2(a) One mark per mark point, max three 3


 line 8 / PassCheck  TRUE
correction PassCheck  FALSE
 line 12 / IF Password <> Password
correction IF Password2 <> Password // IF Password <> Password2
 line 18 / UNTIL PassCheck OR Attempt <> 3
correction UNTIL PassCheck OR Attempt = 3 / UNTIL PassCheck OR Attempt >= 3

2(b) One mark check, one mark matching description, max four 4
Check: validation // length check
Description length check // checks number of characters in password
Check: verification // double entry
Description double entry // comparison that two inputs are the same

2(c) One mark per set, one mark matching reason, max four 4
Set 1 – any appropriate example e.g. “small”
Reason must follow through from the password given e.g. abnormal data will be rejected
Set 2 – any different appropriate example e.g. “password” and “password”
Reason must be different and follow through from the password given e.g. normal data will be accepted

Question Answer Marks

3(a) One mark per mark point, max two 3


 a list / one column of items
 … of the same data type
 … stored under a single identifier
 … with a single index to identify each element

One mark for an example of a declaration


 example e.g. DECLARE MyArray[1:10] OF INTEGER

© UCLES 2022 Page 9 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

3(b) One mark per mark point, max two 2


 using a counter to index the array
 so that the same code can be repeatedly used to check every element // every element can be checked in a loop

Question Answer Marks

4(a) One mark for each correct column 7


Counter Hot Cold Serve Temp Error OUTPUT

0 0 0 0

1 1 75

2 2 78

3 3 84

4 1 87 Too Hot

5 2 91 Too Hot

6 4 80

7 5 75

8 6 70

9 7 65

10 1 62 Too Cold

-1 30 30

© UCLES 2022 Page 10 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

4(b)  include a message to explain the value output / e. g. “The percentage of meals not served” // 1
outputting Hot, Cold and Serve

4(c)  updating the Serve variable // Serve  Serve + 1 1

© UCLES 2022 Page 11 of 12


0478/22 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

5(a) One mark per mark point, max four 4


 correct rows Field and Table
 correct row Show
 correct Criteria for SingleUse or/and Uses
 correct Criteria for StockLevel less than ReorderLevel

Field: ItemNumber Description SingleUse StockLevel

Table: NURSE NURSE NURSE NURSE

Sort:

Show:    

Criteria: True <[ReorderLevel]

or:

Or
Field: ItemNumber Description Uses StockLevel

Table: NURSE NURSE NURSE NURSE

Sort:

Show:    

Criteria: =1 <[ReorderLevel]

or:

5(b) the field Uses already shows this information // duplication of data // redundant data 1

© UCLES 2022 Page 12 of 12


Cambridge IGCSE™
* 8 1 1 3 9 3 2 4 8 5 *

COMPUTER SCIENCE 0478/23


Paper 2 Problem-solving and Programming May/June 2022

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● Do not attempt Tasks 1, 2 and 3 in the copy of the pre-release material on page 2; these are for
information only.
● Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● Calculators must not be used in this paper.

INFORMATION
● The total mark for this paper is 50.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.

This document has 12 pages. Any blank pages are indicated.

DC (CJ) 303921/2
© UCLES 2022 [Turn over
2

Section A

You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the following tasks before the
examination to answer Question 1.
Pre-release material

Seaview Castle Visitor Centre is open seven days a week. It offers a range of facilities and activities
including meeting rooms, a permanent fossil exhibition, supervised walks along the cliff tops and an
old stone quarry.
There are three meeting rooms, which can each be booked separately. There is one large room
that can be used for a variety of activities such as showing films, holding presentations, displaying
exhibitions or wedding receptions. There are also two smaller meeting rooms. Each room can be
booked by the day according to the following tariff:

Room Cost per day


large $295
small 1 $175
small 2 $150

Write and test a program or programs to arrange meeting room bookings:


• Your program or programs must include appropriate prompts for the entry of data. Data must be
validated on entry.
• All outputs, including error messages, need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
Task 1 – setting up a booking system structure for the meeting rooms
Set up suitable data structures for each of the three meeting rooms to store:
• when it is booked during a fixed eight-week period
• the client’s name (the person making the booking)
• a unique booking code
• the cost of the booking.
Task 2 – booking a meeting room
Extend the program in Task 1 to enable bookings to be made so that the client enters their name,
the meeting room required and the day of the booking. After the data has been entered, the program
should check if the requested day is available for the required meeting room and if not, the client
should be allowed to enter an alternative day or exit the program.
If the requested day is available, the booking details and cost of the booking should be output for
the client to confirm. Once confirmed, a unique booking code should be generated and stored in
both the appropriate meeting room data structure and the unique booking code data structure. The
client’s name and cost of the booking should be stored in the appropriate data structures set up in
Task 1.
Bookings of more than one day must be entered as separate single day bookings.
Task 3 – using the booking data
Extend the program in Task 1 and Task 2 to make use of the data that is available, to:
• select a meeting room and output the days when it is free
• total and output the amount of money currently taken for all three meeting rooms
• check the bookings for a specific client.
© UCLES 2022 0478/23/M/J/22
3

1 All variables, constants and other identifiers must have meaningful names.

(a) Identify one variable and one array you could have used for Task 1 or Task 2.

Give the use for the variable and array.

Variable .....................................................................................................................................

Use ...........................................................................................................................................

...................................................................................................................................................

Array .........................................................................................................................................

Use ...........................................................................................................................................

............................................................................................................................................. [4]

(b) Describe how you could test if the validation of the input to choose a meeting room works
(Task 2).

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(c) Explain how your program in Task 2 could be altered to allow a 30% discount on bookings for
the same meeting room of two to six days, inclusive.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2022 0478/23/M/J/22 [Turn over


4

(d) Write an algorithm to show how your program completes the following parts of Task 2:

• output the booking details and cost of the booking


• take confirmation from the client
• generate a unique booking code
• store the booking details.

Assume that Task 1 and the first part of Task 2 have been completed.

Assume that the booking is for a single day and that the requested booking day is available.

Use pseudocode, programming statements or a flowchart.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................
© UCLES 2022 0478/23/M/J/22
5

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [6]
© UCLES 2022 0478/23/M/J/22 [Turn over
6

(e) Explain how your program selects a meeting room, finds and then outputs the days when it
is available (part of Task 3). Any programming statements used in your answer must be fully
explained.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

© UCLES 2022 0478/23/M/J/22


7

Section B

2 Tick (3) one or more boxes in each row to match the type(s) of test data to each description.

Types of test data


Description Erroneous /
Boundary Extreme Normal
Abnormal

test data that is always on the limit of


acceptability

test data that is either on the limit of


acceptability or test data that is just
outside the limit of acceptability

test data that will always be rejected

test data that is within the limits of


acceptability

[4]

3 Describe what is meant by the terms variable and constant and give an example of each in your
answer.

Variable ............................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Constant ...........................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
[4]

© UCLES 2022 0478/23/M/J/22 [Turn over


8

4 The pseudocode represents an algorithm.

The pre-defined function DIV gives the value of the result of integer division.
For example, Y = 11 DIV 4 gives the value Y = 2

Count ←0
INPUT Limit
FOR In ←

1 TO Limit
Logic

TRUE
Test 2
INPUT Number
REPEAT
IF Number / Test = Number DIV Test


THEN
Logic FALSE
ELSE
Test ←Test + 1
ENDIF
UNTIL NOT Logic OR Test >= Number DIV 2
IF Logic


THEN


Store[Count] Number
Count Count + 1
ENDIF
NEXT In
FOR Out ←
0 TO Count - 1
OUTPUT Store[Out]
NEXT Out

(a) Complete the trace table for the algorithm using this input data:
5, 9, 5, 8, 10, 7

Store
In Logic Test Number Count Limit Out OUTPUT
[Count]

[7]
© UCLES 2022 0478/23/M/J/22
9

(b) State the purpose of this algorithm.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

(c) This algorithm only works for numbers that are 3 or greater.

Describe how you could change this algorithm to make sure that only numbers that are
3 or greater are entered. Any pseudocode statements used in your answer must be fully
described.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [3]

© UCLES 2022 0478/23/M/J/22 [Turn over


10

5 The flowchart shows an algorithm that should:


• allow 100 numbers to be entered into the variable Number
• total the numbers as they are entered
• output the total and average of the numbers after they have all been entered.

Complete this flowchart:

START

Total 0

Counter 0

No

Yes

END
[6]
© UCLES 2022 0478/23/M/J/22
11

6 Data about planets in the solar system is stored in a database table called PLANETS. The fields
used in the table are shown.

Name of field Contents of field


PlanetName the name of the planet
PlanetMass the planet’s mass in kilograms
Larger whether or not the planet has a greater mass than Earth
MaxDistance the maximum distance the planet is from Earth in kilometres
MinDistance the minimum distance the planet is from Earth in kilometres
YearLength the length of time it takes for the planet to orbit the Sun in Earth days

(a) State the name of the field that could contain Boolean data.

............................................................................................................................................. [1]

(b) Complete the query-by-example grid to output the planets with a longer year length and
greater mass than Earth. Assume Earth’s year length is 365 days.

Display only the name of the planets sorted in alphabetical order.

Field:

Table:

Sort:

Show: o o o o o
Criteria:

or:
[3]

© UCLES 2022 0478/23/M/J/22


12

BLANK PAGE

Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at [Link] after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

© UCLES 2022 0478/23/M/J/22


Cambridge IGCSE™

COMPUTER SCIENCE 0478/23


Paper 2 Problem Solving and Programming May/June 2022
MARK SCHEME
Maximum Mark: 50

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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 13 printed pages.

© UCLES 2022 [Turn over


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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 descriptors 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.

© UCLES 2022 Page 2 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
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.

© UCLES 2022 Page 3 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Please note the following further points:

The words in bold in the mark scheme are important text that needs to be present, or some notion of it needs to be present. It does not have to
be the exact word, but something close to the meaning.

If a word is underlined, this exact word must be present.

A single forward slash means this is an alternative word. A double forward slash means that this is an alternative mark point.

Ellipsis (…) on the end of one-mark point and the start of the next means that the candidate cannot get the second mark point without being
awarded the first one. If a mark point has an ellipsis at the beginning, but there is no ellipsis on the mark point before it, then this is just a follow-on
sentence and can be awarded without the previous mark point.

© UCLES 2022 Page 4 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

Section A

1(a) Many correct answers, the names used must be meaningful. The names given are examples only. 4
One mark per mark point, max four

 Variable ClientName
 Use Storing the name of the person making the booking

 Array BookingsLarge[ ]
 Use Storing the bookings for the large meeting room

Task 1 – setting up a booking system structure for the meeting rooms


Set up suitable data structures for each of the three meeting rooms to store:
 when it is booked during a fixed eight-week period
 the client’s name (the person making the booking)
 a unique booking code
 the cost of the booking.

Task 2 – booking a meeting room


Extend the program in Task 1 to enable bookings to be made so that the client enters their name, the meeting room
required and the day of the booking. After the data has been entered, the program should check if the requested day is
available for the required meeting room and if not, the client should be allowed to enter an alternative day or exit the
program.

If the requested day is available, the booking details and cost of the booking should be output for the client to confirm.
Once confirmed, a unique booking code should be generated and stored in both the appropriate meeting room data
structure and the unique booking code data structure. The client’s name and cost of the booking should be stored in the
appropriate data structures set up in Task 1.

Bookings of more than one day must be entered as separate single day bookings.

© UCLES 2022 Page 5 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(b) One mark per mark point, max two 2

MP1 input a piece of normal test data that should be accepted // use Large, Small1 or Small2 to check that these data
are accepted // use a menu and check the input matches the available options
MP2 Input a piece of erroneous test data that should be rejected // entry of anything that is not Large, Small1 or Small2
should be rejected // anything not on the menu should be rejected

Explanation Task 2

1(c) One mark per mark point, max four 4

MP1 introduce a (new) variable/array for the number of days for the booking // introduce a (new) variable/array for the
number of days for booking the same room // identify the number of days the same room has been booked by the
same client
MP2 use a conditional/IF statement to check if the length of the booking is 2 to 6 inclusive / 2, 3, 4, 5, or 6 //Use a
CASE statement
MP3 … if it is, get the daily rate for the room booking
MP4 … multiply the number of days for the booking by the room rate
MP5 … multiply the total cost of the booking by 70%/.7// reduce the total cost by 30%

Explanation Task 2

© UCLES 2022 Page 6 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) One mark per mark point, max six 6

MP1 output all relevant input data using suitable variables for client name, meeting room choice, the booking day and
the booking cost
MP2 attempt to provide appropriate messages to accompany given output
MP3 input with messages to confirm booking
MP4 conditional statement or WHILE to check for a positive confirmation input
MP5 attempt at generation of booking code
MP6 fully unique booking code generated
MP7 identification of meeting room using CASE or IF statements
MP8 storage of booking code in both meeting room and booking code arrays/lists
MP9 storage of client name and booking cost in appropriate arrays/lists

Relevant parts of Task 2 for this question:


 output the booking details and cost of the booking
 take confirmation from client
 generate a unique booking code
 store the booking details.

Assume the booking is for a single day and the requested booking day is available.

Example answer
//Assume variables representing the current index position for the client //related
arrays, ClientIndex, and index for date related arrays, //DateIndex, have been used
OUTPUT "Your name is ", ClientName, Meeting Room ", MeetingRoom,
" starting on ", StartDay, " cost of booking ", BookingCost
OUTPUT "Is this correct (Y or N)"
INPUT Confirm
IF Confirm = "Y"
THEN
BookingCode  BookingCode + 1
CASE OF MeetingRoom
'Lg': MeetingLarge[DayIndex]  BookingCode
'S1': MeetingSmall1[DayIndex]  BookingCode
'S2': MeetingSmall2[DayIndex]  BookingCode

© UCLES 2022 Page 7 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

1(d) ENDCASE
BookingCode[ClientIndex]  BookingCode
ClientName[ClientIndex]  ClientName
BookingCost[ClientIndex]  BookingCost
//No ELSE clause is specified in the task or the question
//so, ignore it if one is given
ENDIF

1(e) One mark per mark point, max four 4

MP1 select the room whose records are to be searched // input the room whose records are to be searched
MP2 use a suitable loop (to search through the array that stores the bookings data for that room)
MP3 use an IF statement/conditional statement to check if the current array element has a booking
MP4 … if not, use the array index to output the day represented
MP5 check each element in the array until all array elements have been checked

Task 3 – using the booking data


Extend the program in Task 1 and Task 2 to make use of the data that is available, to:
 select a meeting room and output the days when it is free
 total and output the amount of money currently taken for all three meeting rooms
 check the bookings for a specific client.

Only the first bullet point required for this question.

© UCLES 2022 Page 8 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

Section B

2 One mark per row, max four 4

Types of test data


Description
Boundary Erroneous / Extreme Normal
Abnormal

test data that is always on the limit of



acceptability

test data that is either on the limit of


acceptability or test data that is just 
outside the limit of acceptability

test data that will always be rejected 

test data that is within the limits of


acceptability  

Question Answer Marks

3 One mark per mark point, max four 4

 variables are used to represent values that can change during the execution of a program // variables can be used to
store the results of calculations / counting / totalling // can store values entered by the user
 variable example – any data that is input into a program such as a date
 constants represent values that must stay the same throughout the execution of a program
 constant example – any value that does not change, such as Pi in mathematical formulae

© UCLES 2022 Page 9 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

4(a) One mark per mark point, max seven 7


MP1 correct In column
MP2 correct Logic column
MP3 correct Test column
MP4 correct Number column
MP5 correct Store[Count] column
MP6 correct Count and Limit columns
MP7 correct Out and OUTPUT columns

Store
In Logic Test Number Count Limit Out OUTPUT
[Count]
0 5
1 TRUE 2 9
3
FALSE
2 TRUE 2 5
3 5 1
3 TRUE 2 8
FALSE
4 TRUE 2 10
FALSE
5 TRUE 2 7
3 7 2 0 5
1 7

© UCLES 2022 Page 10 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

4(b) One mark per mark point, max two 2


 to find / output prime numbers
 … store prime numbers in an array

4(c) One mark per mark point, max three 3

MP1 insert a WHILE loop … // pre-condition loop


MP2 … after Input Number
MP3 … with a condition to enter the loop Number < 3
MP4 an error message included within the loop to ask for a re-entry of Number
MP5 …with another input prompt for Number
MP6 ENDWHILE closes the loop and the program carries on from REPEAT in the original algorithm

OR

One mark per mark point, max three

MP1 insert a REPEAT loop … // post-condition loop


MP2 … before Input Number
MP3 a conditional statement should be placed after Input Number
MP4 …to check if Number < 3
MP5 if the number entered is <3, an error message included within the loop to ask for a re-entry of Number
MP6 UNTIL Number >= 3 closes the loop and the program carries on from REPEAT in the original algorithm

© UCLES 2022 Page 11 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

5 One mark per mark point, max six 6


MP1 input box
MP2 correct totalling using Total
MP3 correct counting using Counter
MP4 correct conditional statement for Counter
MP5 correct calculation of Average
MP6 correct outputs of Total and Average
START

Total  0

Counter  0

INPUT Number

Total  Total + Number

Counter  Counter + 1

No IS Counter =
100?

Yes
Average  Total / Counter

OUTPUT Total

OUTPUT Average

END

© UCLES 2022 Page 12 of 13


0478/23 Cambridge IGCSE – Mark Scheme May/June 2022
PUBLISHED
Question Answer Marks

6(a) Larger 1

6(b) One mark per mark point, max three 3

 correct fields correctly named and table names


 correct sort and show box rows
 correct search criteria

Field: PlanetName Larger YearLength

Table: PLANETS PLANETS PLANETS

Sort: Ascending

Show:     

Criteria: Yes >365

or:

© UCLES 2022 Page 13 of 13

You might also like