You are on page 1of 53

Cambridge IGCSE™

* 1 4 2 8 2 4 6 4 9 8 *

COMPUTER SCIENCE 0478/12


Paper 1 Theory February/March 2022

1 hour 45 minutes

You must answer on the question paper.

No additional materials are needed.

INSTRUCTIONS
● Answer all questions.
● 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 75.
● 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 (LK) 303935/2
© UCLES 2022 [Turn over
2

1 A computer stores data in binary form. Binary numbers can be represented as hexadecimal and
denary numbers.

(a) Convert the 8-bit binary number 01010101 to denary.

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

Working space

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

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

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

(b) Convert the binary number 11000000 to hexadecimal.

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

Working space

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

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

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

(c) Convert the hexadecimal number 1A to denary.

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

Working space

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

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

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

(d) Binary numbers can be stored as bytes.

State how many bits are in two bytes.

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

© UCLES 2022 0478/12/F/M/22


3

2 Nadia creates a digital image for a school project.

(a) Give one example of an image format.

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

(b) Describe how a digital image file is stored by a computer.

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

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

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

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

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

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

(c) Nadia compresses the digital image file before emailing it to a friend.

(i) State what is meant by data compression.

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

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

(ii) Explain why Nadia compresses the digital image file before emailing it.

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

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

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

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

© UCLES 2022 0478/12/F/M/22 [Turn over


4

(iii) Nadia’s email service uses parity bits as a method of error detection during the
transmission of data.

Describe how the parity bits are used to detect errors.

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

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

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

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

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

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

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

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

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

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

(iv) Identify and describe one other method of error detection used during the transmission
of data.

Method ..............................................................................................................................

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

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

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

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

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

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

© UCLES 2022 0478/12/F/M/22


5

3 (a) Tick (3) to show which logic gates will give an output of 1 for the given inputs A and B.

Inputs AND OR NAND NOR XOR


A=1
B=1
A=0
B=0
A=1
B=0
[3]

(b) Draw the logic circuit for the given logic statement:

X = (A XOR B) AND (B OR NOT C)

Do not attempt to simplify the logic statement. All logic gates must have a maximum of two
inputs.

B X

[4]

© UCLES 2022 0478/12/F/M/22 [Turn over


6

4 Pradeep uses his personal computer to complete work at home.

(a) Pradeep uses a mouse and a keyboard to control the computer.

(i) Complete the descriptions of the principles of operation of a mouse and a keyboard
using the most appropriate terms from the list. Not all terms in the list need to be used.

• absorbs
• ball
• biometric
• circuit
• colour
• digital
• direction
• Light-Emitting Diode (LED)
• Liquid Crystal Display (LCD)
• reflects
• speed
• switch
• transparency

An optical mouse shines a red light from a ................................................... underneath

the mouse. The light .................................................. back from a surface through a

lens in the mouse and is converted to a value. This value is transmitted to the

computer. The computer then determines the ................................................... and

................................................... of the movement.

When the user presses a key on a keyboard, the key pushes the

................................................... on the circuit board. This completes a

................................................... . Signals are sent to the computer. The computer uses

the data to calculate which key was pressed.


[6]

(ii) Identify two other input devices Pradeep could use with his personal computer.

Input device 1 ....................................................................................................................

Input device 2 ....................................................................................................................


[2]

© UCLES 2022 0478/12/F/M/22


7

(b) Pradeep uses a projector attached to the ceiling at his home to watch high-definition (HD)
films.

The projector has broken. He wants to buy a replacement. He needs to choose between an
LCD projector and a Digital Light Projector (DLP).

Explain why an LCD projector would be more appropriate for Pradeep.

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

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

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

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

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

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

(c) Pradeep stores his collection of films and his work files on his personal computer.

Pradeep wants to save a copy of all his films and files onto a single storage device.

Identify and justify an appropriate storage device to store the copies.

Storage device ..........................................................................................................................

Justification ...............................................................................................................................

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

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

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

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

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

© UCLES 2022 0478/12/F/M/22 [Turn over


8

5 A holiday company has a website where customers can create accounts and can book and pay for
holidays.

(a) The website is written in Hypertext Markup Language (HTML).

Give two examples of HTML structure and two examples of HTML presentation.

Structure 1 ................................................................................................................................

Structure 2 ................................................................................................................................

Presentation 1 ..........................................................................................................................

Presentation 2 ..........................................................................................................................
[4]

(b) The website is stored on a web server. Customers use their own computers to access the
website.

Uniform Resource Locator (URL), Internet Protocol (IP) and Media Access Control (MAC) are
three types of address used by computers when accessing the Internet.

Give two features of each type of address in the table.

Type of
Features
address

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

............................................................................................................................
URL
............................................................................................................................

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

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

............................................................................................................................
IP
............................................................................................................................

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

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

............................................................................................................................
MAC
............................................................................................................................

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

© UCLES 2022 0478/12/F/M/22


9

(c) The company is concerned about threats to its web server.

Complete the table by identifying:

• two potential threats to its web server


• the impact each threat could have on the company
• software the company can use to help to limit each threat.

Each impact must be different.

Threat Impact on company Software

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

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

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

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

© UCLES 2022 0478/12/F/M/22 [Turn over


10

6 A business uses a closed-circuit television (CCTV) system that starts recording when motion is
detected. It stops recording after two minutes if no further motion is detected. The system uses a
motion sensor and a microprocessor.

Describe how the motion sensor and microprocessor work together to control the CCTV system.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.................................................................................................................................................... [7]

© UCLES 2022 0478/12/F/M/22


11

7 Ishani is a software developer who is creating a new computer game.

(a) Ishani uses an interpreter and a compiler at different stages of the game creation.

(i) Explain when it is most appropriate for Ishani to use an interpreter.

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

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

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

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

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

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

(ii) Explain when it is most appropriate for Ishani to use a compiler.

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

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

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

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

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

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

(b) Ishani has to decide between releasing her game as freeware or free software.

Describe freeware and free software.

Freeware ..................................................................................................................................

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

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

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

Free software ............................................................................................................................

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

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

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

© UCLES 2022 0478/12/F/M/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 www.cambridgeinternational.org 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/12/F/M/22


0478/12 Cambridge International IGCSE - Mark Scheme
March 2022
STANDARDISATION

Cambridge Assessment International Education


Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/12


Paper 1 Theory March 2022
MARK SCHEME

Standardisation

MAXIMUM MARK: 75

Page 1 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
Cambridge Assessment International Education – 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.

Page 2 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
Specific Marking Principles

Page 3 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
Question Answer Marks Guidance

1(a) 85 1
1(b) C0 1
1(c) 26 1
1(d) 16 1
2(a) e.g. JPEG 1

Page 4 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
2(b) Any three from: 3
• Image is made of pixels
• Each pixel stores one colour
• Image has a set number of pixels wide by pixels high
• Each colour has a unique binary value // Each colour has a unique colour code
• The colour/binary value of each pixel is stored in sequence
• File contains metadata to identify how the file should be displayed
• … metadata can be the colour depth / resolution

2(c)(i) Reducing the file size 1


2(c)(ii) Any two from: 2
• reduces the storage/memory space taken on email server // reduces the storage space
taken on her friend's computer when downloaded
• sending/receiving email accounts may have restricted file size for attachments
• reduces the time taken to transmit/upload/download to destination
• reduces amount of bandwidth needed to transmit/download
• file will mean less data usage is taken (for mobile clients)

Page 5 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
2(c)(iii) Any five from: 5
• Parity can be set to odd or even
• Sender and receiver agree on parity to use
• Data/email/image is split into bytes // blocks of 7 bytes
• Sender counts the number of 1s/0s in each group/byte
• Each group/byte is assigned a parity bit to match the parity/odd/even
• Receiving device/server recounts the number of 1s/0s in each group/byte
• … and compares to parity used/odd/even and if it does not match the parity, an error is
reported/identified
• (in block check) the location of the error(s) can be identified/estimated at the intersection
2(c)(iv) 1 mark for identification 4
Any three for corresponding description:

• Checksum
• Value is calculated from the data …
• …using an algorithm // by example
• Value is transmitted with the data
• Value recalculated by receiver (using same algorithm) …
• …if checksum values are different there is an error // reverse

• Automatic Repeat request/reQuery (ARQ)


• Uses acknowledgement and timeout
• Sender starts a timer when data is transmitted
• Receiver uses an error checking method to check whether the data has been received
accurately
• If no error detected a positive acknowledgement is returned to sender
• If error detected negative acknowledgement is returned to sender
• If sender gets no acknowledgement within the set time it resends the data

Page 6 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
3(a) 1 mark per row 3
Inputs AND OR NAND NOR XOR
A=1
✓ ✓
B=1

A=0
✓ ✓
B=0

A=1
✓ ✓ ✓
B=0

3(b) 1 mark per gate 4

B
x

• A XOR B
• NOT C
• (NOT C) OR B
• AND
4(a)(i) 1 mark for each completed statement 6

Page 7 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION

An optical mouse shines a red light from a Light-Emitting Diode//LED underneath the mouse.
The light reflects back from a surface through a lens in the mouse and is converted to a value.
This value is transmitted to the computer. The computer then determines the direction and speed
of the movement.

When the user presses a key on a keyboard, the key pushes the switch on the circuit board. This
completes a circuit. Signals are sent to the computer that uses the data to calculate which key
was pressed. 1

4(a)(ii) 1 mark each e.g. 2


• touchscreen
• touchpad
• scanner
• microphone

Page 8 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
4(b) Any three from: 3
• More visible pixels // higher resolution
• Higher colour contrast (in ambient lighting) // more vivid colours
• Colours are (often) more accurate
• Image (usually) appears brighter (with same wattage)
• Will be stationary so does not need the portability of DLP
• Does not need the compactness of DLP
• Cost of purchase (usually) less
• Run quieter
• Any surface can be used as a display
• Uses less power
• Produces less heat
• Does not give the rainbow effect DLP often gives
• Longer lasting lamps

Page 9 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
4(c) 1 mark for naming appropriate device 4
• hard disk / HDD / magnetic
• solid state drive / SSD / USB memory stick / flash drive

1 mark each for matching justification to max 3.


e.g.
HDD
• Large capacity storage
• …for videos/films that have large file sizes / require large storage space
• Longevity // Can be read from/written to large number of times
• … the copies will be accessible for a long time // device will not break if accessed regularly
• …may require large number of read/write to access fields
• Relatively cheap per GB // cheaper than SSD per GB …
• … there is a large capacity required therefore overall may cost less than other devices
• Device will not be moved regularly so no need for portability/durability
SSD
• Large capacity storage
• …for videos/films that have large file sizes / require large storage space
• No moving parts
• …can be carried/moved to other locations with limited risk of damage
• Fast access speed
• … videos are large files that will be stored/accessed in less time
• Cost per GB is not significant (in comparison)
• …there is a large capacity required therefore overall cost will not be significantly more than
others
• Used as a copy of files to may not be accessed regularly
• … the limited number of read/write times/longevity is inconsequential
• Uses less power // runs cooler
• No latency // does not take time to start-up

Page 10 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
5(a) 1 mark for each example, allow description or tags 4
Structure e.g.
• head
• body
• table
• heading
• subheading
• paragraph
• object position on the page // alignment
• margins
• borders (position/size)
• padding

Presentation e.g.
• colour
• font size
• font style
• border (style)

Page 11 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
5(b) 1 mark for each bullet to max 2 for each 6
Type of
Features
address

• protocol
• domain name
URL • top level domain
• file/folder name/address/directory/path
• made up of letters, numbers and symbols

IPv4:
• 4 groups of numbers // 12 numbers
• separated by full stops (.)
• 0-255 in each group
• 4 bytes long // 32 bits
• Represented in denary

IP
IPv6:
• 8 groups of numbers // 32 numbers
• separated by colons (:)
• 0-FFFF in each group
• 16 bytes long // 128 bits
• Consecutive groups of 0000 can be replaced with ::
• Represented in hexadecimal

• First part is manufacturer ID


• Second part is serial number
• Each part has 3 pairs of numbers // Each part has 6 numbers //
MAC
6 pairs of 2-digits // consists of 12 numbers
• …between 00 and FF
• ..separated by :
Page 12 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
• Each part is 3 bytes // Is 6 bytes long // Is 48 bits long
• Represented using hexadecimal

5(c) 1 mark for threat. 1 for impact. 1 for software. 6

Do not award identical impacts twice, but read whole answer and award if additional impact given.
Allow the same software twice.
e.g.
Threat Impact on company Software
Denial of service • Users cannot access the website Proxy/firewall
• Loss of sales (of holidays)
• Loss of reputation
Virus/malware • Data on the server may be Anti-virus
deleted/changed
• Website may be deleted/changed
• Server may be filled with data and
crash
Unauthorised • Data could be Proxy/Firewall
access // hacker deleted/stolen/changed

Page 13 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
6 Any seven from: 7
• (Motion) sensor sends signals to microprocessor
• analogue signal is converted to digital
• microprocessor compares signal to stored value …
• …if it does not meet / meets the stored value (and if camera is not recording) the
microprocessor sends signal (to camera) to start recording
• … if it does not meet / meets the stored value the microprocessor starts/resets the timer
• When the timer reaches 2 minutes the microprocessor sends signal (to camera) to stop
recording
• Whole process is repeated continually/until turned off

Page 14 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
7(a)(i) 1 mark for when 3
e.g.
• Development // when writing the program // when debugging

1 mark for explanation to max 2 from:


e.g.
• … easier to debug
• …stops when an error is detected
• …reports one error at a time
• …can correct errors in run-time // correct the line and then continue running from that point
• …can test one section without the rest of the code being completed

Page 15 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
7(a)(ii) 1 mark for when 3
e.g.
• After completion // For distribution // For final/repeated testing

1 mark each to max 2 from: e.g.


After completion
• It creates an executable file
• …than can be distributed without source code
• …so that other people cannot edit/view the code
• …so end users do not need translator software // so end users do not need to
compile/interpret each time
• …so it is machine/platform independent (usually)
In final testing
• It creates an executable file
• …do not need to retranslate for each test sequence
• …can test repeatedly with different data faster

Page 16 of 17
0478/12 Cambridge International IGCSE - Mark Scheme March 2022
STANDARDISATION
7(b) Any four from, max 2 from each: 4
Freeware:
• There is no cost to the user // free trial
• No source code provided
• …cannot be modified
• Can be redistributed (in same state)
• Is subject to copyright

Free software:
• User has access to the source code
• Can be modified (without restriction)
• Can be redistributed (without restriction)
• Can have a cost associated but does not have to
• Is subject to copyright

Page 17 of 17
Cambridge IGCSE™
* 7 8 1 6 1 9 5 1 1 4 *

COMPUTER SCIENCE 0478/22


Paper 2 Problem-solving and Programming February/March 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 16 pages. Any blank pages are indicated.

DC (CJ) 303924/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

A program is needed to record the number of strokes played by each player in a round of golf and
decide who is the winning player.
The object of the game of golf is to hit a small ball into a series of small holes using a golf club.
A score is kept of the number of times a player needs to hit the ball to get it in a hole; this is the
number of strokes for the hole. The total score for a round of golf is the total number of strokes taken
for each hole. The player with the least number of strokes is the winner.
A golf course consists of 9 or 18 holes. A round of golf is completed when all the holes have been
played. There can be 2, 3 or 4 players taking part in a round of golf. The number of strokes that
an experienced golfer would take to complete a round is called par. The scores for the round are
displayed in relation to the par score. For example, if par for an 18-hole course was 72, a score of 80
would be 8 over par and a score of 70 would be 2 under par.
Write and test a program or programs to score a round of golf:
• 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 the round
Each player’s scores for the round are to be stored in an array with a separate score for each hole.
The scores in these arrays are to be set to zero before a round starts.
The following data is to be input and stored:
• the number of players taking part in the round
• the names of the players
• the number of holes to be played: 9 or 18
• the par for the course.
The number of players, their names, the number of holes to be played and the par for the course are
all displayed to be checked before the round starts so that any errors seen can be corrected.
Task 2 – scoring the round
For each hole played, each player’s name is displayed on the screen and they are asked to enter
the number of strokes they played for that hole. Each player must enter the number of strokes twice
to verify their score. A player can choose to see the total number of strokes that they have played so
far in the round.
Task 3 – deciding the winning player
At the end of the round, display the name and final score for each player relative to par. The winner
is identified; display their name and the winning score. There are also options that display:
• every player’s score for each hole
• the player’s name and hole number of any score of one for a hole (hole-in-one)
• the average score for the round
• the average score for a hole.

© UCLES 2022 0478/22/F/M/22


3

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

(a) State one constant and 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. Explain why the
constant was used rather than a variable and explain why the variable was used rather than a
constant.

Constant name .........................................................................................................................

Value .........................................................................................................................................

Why a constant was used .........................................................................................................

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

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

Variable name ...........................................................................................................................

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

Why a variable was used ..........................................................................................................

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

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

(b) Describe how your program set the scores to zero before each round for Task 1.

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

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

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

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

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

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

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

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

© UCLES 2022 0478/22/F/M/22 [Turn over


4

(c) Write an algorithm for Task 2, using pseudocode, programming statements or a flowchart.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2022 0478/22/F/M/22


5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2022 0478/22/F/M/22 [Turn over


6

(d) Explain how your program completed part of Task 3 to identify the winner and to display their
name and the winning score relative to par. All programming statements that you include
must be fully explained.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© UCLES 2022 0478/22/F/M/22


7

Section B starts on page 8

© UCLES 2022 0478/22/F/M/22 [Turn over


8

Section B

2 An algorithm has been written to:

• input the ages of 100 students


• count and output the number of students aged 7 and under 12
• count and output the number of students aged 12 and under 18
• count and output the number of students aged 18 and over.

(a) Complete the pseudocode algorithm:

01 Count7to12 0 ←
02 Count12to18 0 ←
03 CountOver18 0 ←
04 FOR Student ←
1 TO ............................................
05 OUTPUT "Please enter student's age in years "
06 INPUT Age
07 IF Age >= 7 ................................................
08 THEN
09 Count7to12 Count7to12 + 1 ←
10 ENDIF
11 IF Age >= 12 AND Age < 18
12 THEN
13 Count12to18 ←
.........................................
14 ENDIF
15 IF Age >= 18
16 THEN
17 CountOver18 CountOver18 + 1 ←
18 ENDIF
19 NEXT Student
20 OUTPUT "There are ", Count7to12, " students aged 7 and under 12."
21 OUTPUT "There are ", Count12to18, " students aged 12 and under 18."
22 OUTPUT "There are ", ................., " students aged 18 and over."
[4]

(b) Write the extra pseudocode statements that are needed to count and output the number of
students under the age of 7. Use the variable CountUnder7; assume CountUnder7 has
already been set to zero.

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

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

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

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

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

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

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

© UCLES 2022 0478/22/F/M/22


9

3 Four validation checks and five descriptions are shown.

Draw a line from each validation check to the most appropriate description.

Validation check Description

checks that the data input is


between two values

length check

checks that the data input is


an integer

check digit

checks that the data input has


three digits

range check

checks that the data has


been input

type check

checks that the data input has


the correct digits
[4]

© UCLES 2022 0478/22/F/M/22 [Turn over


10

4 This flowchart inputs a whole number. The function INT returns the integer value of a number. For
example, INT (7.5) is 7

An input of -1 ends the routine.

START

INPUT Number

IS Number Yes
END
= –1?
No

C 0
D INT(Number/2)

IS
INT(Number/D) Yes
= Number/D?

No
C C + 1

D D – 1

No IS D =
1?

Yes

Yes IS C =
0?
No

OUTPUT C

© UCLES 2022 0478/22/F/M/22


11

(a) Complete the trace table for the given algorithm using this input data:
7, 6, 5, 4, –1, 12, 34

Number C D OUTPUT

[6]

(b) Describe the purpose of this algorithm.

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

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

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

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

(c) (i) Describe the problem that occurs if a whole number smaller than 4 and not equal to –1
is input.

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

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

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

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

(ii) Explain how to change the flowchart to prevent this problem occurring.

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

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

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

..................................................................................................................................... [2]
© UCLES 2022 0478/22/F/M/22 [Turn over
12

5 A database table, FLOWER, is used to keep a record of the type of flowers available to make up a
bouquet.

FlowerID Type Colour Style Fragrance


CN001 Carnation Pink Stem Y
CN002 Carnation Red Stem N
CN103 Carnation White Stem N
CN104 Carnation Yellow Stem Y
CN105 Carnation Pink Spray Y
CN106 Carnation Red Spray N
CN107 Carnation White Spray N
CN108 Carnation Yellow Spray Y
RE101 Rose Pink Stem Y
RE102 Rose Red Stem Y
RE103 Rose White Stem N
RE104 Rose Yellow Stem Y
RE105 Rose Orange Spray Y
RE106 Rose Peach Spray N
LY101 Lily White Spray Y

© UCLES 2022 0478/22/F/M/22


13

A query-by-example has been written to display just the type, style and colour of all flowers that
have no fragrance.

Field: FlowerID Fragrance Style Colour

Table: FLOWER FLOWER FLOWER FLOWER

Sort:

Show: 3 3 3 3

Criteria: =Y

or:

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

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

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

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

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

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

Field:

Table:

Sort:

Show:

Criteria:

or:
[6]

© UCLES 2022 0478/22/F/M/22


14

BLANK PAGE

© UCLES 2022 0478/22/F/M/22


15

BLANK PAGE

© UCLES 2022 0478/22/F/M/22


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 www.cambridgeinternational.org 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/F/M/22


Cambridge Assessment International Education

Cambridge International General Certificate of Secondary Education

COMPUTER SCIENCE 0478/22

Paper 2 March 2022

MARK SCHEME

Maximum Mark: 50

IMPORTANT NOTICE
Mark Schemes have been issued on the basis of one copy per Assistant examiner and two copies per Team
Leader.

Pre-standardisation

This document consists of 8 printed pages.

© UCLES 202 [Turn over


0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation

Question Answer Marks Guidance

Section A
1(a) Many correct answers, the names used must be meaningful. The names given are examples only. 6 Many correct
answers, they must
One mark per mark point, max three be meaningful.
Constant name MaxNumberPlayers The names are
Value 4 examples only.
Why constant used This number will not change whilst the program is running Do not accept spaces
or punctuation as part
One mark per mark point, max three of a name.
Variable name NumberOfPlayers
Data type Integer/int
Why variable used A value between 2 and 4 inclusive is input and stored at the start of the round
1 (b) One mark per mark point, max four 4 Discuss if loop not
used at STM
MP1 using a FOR … NEXT // REPEAT … UNTIL // DO … WHILE loop All code NAQ
MP2 starting at 1/0 and finishing at 18/17 or 9/8 // 10 iterations
MP3 … and an assignment statement
MP4 … for each array // all four arrays // number of arrays for players in this round
MP5 … setting each element in each array to zero

Any programming statements included must be explained.

Page 2 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
1(c) One mark per mark point, max six 6

MP1 loop through the number of holes played


MP2 for each hole loop through the number of players
MP3 for each player display their name
MP4 … prompt to enter the number of strokes played for the hole
MP5 … input the number of strokes twice
MP6 … validate both inputs are the same
MP7 … store the number of strokes in the appropriate array
MP8 … prompt to ask if the player wants to see the number of strokes played so far
MP9 … output number of strokes if required

Example Answer
FOR Hole  1 TO NumberOfHoles
FOR Player  1 TO NumberOfPlayers
REPEAT
OUTPUT PlayerName[Player], "Please enter the number of strokes played for hole ", Hole
INPUT NumberStrokes
OUTPUT PlayerName[Player], " please re-enter the number"
INPUT NumberStrokesAgain
UNTIL NumberStrokes = NumberStrokesAgain
IF Player = 1
THEN
Player1[Hole]  NumberStrokes
Player1Total  Player1Total + NumberStrokes
OUTPUT "Do you want to see number total of strokes played so far Y/N? "
INPUT SeeTotal
IF SeeTotal = "Y"
THEN
OUTPUT "Total number of strokes so far ", Player1Total
ENDIF
ENDIF
IF Player = 2
THEN
Player2[Hole]  NumberStrokes
Player2Total  Player2Total + NumberStrokes
OUTPUT "Do you want to see number total of strokes played so far Y/N? "
INPUT SeeTotal
IF SeeTotal = "Y"
THEN
OUTPUT "Total number of strokes so far ", Player2Total
ENDIF
ENDIF

Page 3 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
IF Player = 3
THEN
Player3[Hole]  NumberStrokes
Player3Total  Player3Total + NumberStrokes
OUTPUT "Do you want to see number total of strokes played so far Y/N? "
INPUT SeeTotal
IF SeeTotal = "Y"
THEN
OUTPUT "Total number of strokes so far ", Player3Total
ENDIF
ENDIF
IF Player = 4
THEN
Player4[Hole]  NumberStrokes
Player4Total  Player4Total + NumberStrokes
OUTPUT "Do you want to see number total of strokes played so far Y/N? "
INPUT SeeTotal
IF SeeTotal = "Y"
THEN
OUTPUT "Total number of strokes so far ", Player4Total
ENDIF
ENDIF
NEXT Player
NEXT Hole

1(d) Explanation 4 All code NAQ


One mark per mark point, max four

MP1 compare the total scores using selection / IF statements


MP2 select the score with the lowest value
MP3 … also select the player
MP4 compare the score with the lowest value with the value of par using selection / IF statements
MP5 output the player name and the difference between par and their score …
MP6 … output “over par” if the value is greater than par or output “under par” if the value is less than par or
output “par” if there is no difference

Any programming statements included must be explained.

Page 4 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
Section B
2 (a) One mark per mark point, max one 4
• 100
• AND Age < 12
• Count12to18 + 1
• CountOver18

2(b) One mark suitable IF construct, one mark correct assignment statement, for example 4
IF Age < 7
THEN
CountUnder7  CountUnder7 + 1
ENDIF
One mark suitable message, one mark correct use of countUnder7 variable, for example
OUTPUT "There are ", CountUnder7, " students aged under 7."

Page 5 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
3 One mark for each correct line, max four 4

checks that the data input is


between two values

length check

checks that the data input is


an integer

check digit

checks that the data input has


three digits

range check

checks that the data has


been input

type check

checks that the data input has


the correct digits

Page 6 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
4(a) One mark each for columns Number and OUTPUT 6 Mark by
Two marks for column C first four values (1) last three values (1) columns
Two marks for column D first six values (1) last four values (1)

Number C D OUTPUT
7 0 3
2
1
6 0 3
1 2
2 1 2
5 0 2
1
4 0 2
1 1 1
-1

4(b) One mark per mark point, max two 2 Accept any
• to count the factors / the numbers that go into (other than 1 or itself) of a number explanation of
• to output the number of factors factors

4(c)(i) One mark per mark point, max two 2


• the value of D becomes zero
• division by zero error
4(c)(ii) One mark per mark point, max two 2 discuss other
• after the decision box to test if the number is -1 answers at STM
• insert another decision box to test if the number is less than 4 / less than or equal to 3

Page 7 of 8
0478/22 Qualification - Mark Scheme 03/2022
Pre-standardisation
5 Explanation 6
One mark per mark point, max three
• field, FlowerID, not required / should not be displayed
• Type field not included and displayed
• Fragrance field should not be displayed
• Fragrance criteria should not be Y

Field: Type Fragrance Style Colour


Table: FLOWER FLOWER FLOWER FLOWER
Sort:
Show:    
Criteria: =N
or:

Q-B-E grid
One mark per mark point, max three

• One mark for changing Flower ID to Type


• One mark for changing Criteria in Fragrance to N
• One mark for changing Show to in Fragrance to 

Page 8 of 8

You might also like