Cambridge IGCSE: Computer Science 0478/23
Cambridge IGCSE: Computer Science 0478/23
Cambridge IGCSE: Computer Science 0478/23
* 1 6 4 9 5 4 6 1 5 9 *
1 hour 45 minutes
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.
DC (LK/CB) 303980/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 for a window cleaning company to store details of the services provided to their
customers for each cleaning job.
The data stored will be used to show the customers exactly what services they are paying for
(provide an itemised bill). The data will allow the company to find out which services are used most
often and least often.
The services available to customers are:
Service Cost
basic window clean outside, only one floor, up to five windows $10.00
additional windows up to and including five $5.00
two floors 10% extra
three floors 15% extra
inside as well 25% extra
polish all windows cleaned 5% extra
special solar panel clean $20.00
The total cost of the customer’s bill is calculated in the same order as the rows of the table.
For example, a customer who has six windows over three floors is charged $10 + $5 with 15% extra,
giving a total bill of $17.25.
Write and test a program or programs for the window cleaning company:
• 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 system to store the customer and service details
Set up your program to:
• store a customer name and address in a single dimensional array at the next position
• use the array index of this position as the unique number of the itemised bill
• store any service required at the same position in the appropriate service array; use an array for
each service.
Task 2 – storing the services for a customer and displaying the itemised bill
Extend your program to:
• display the services and the cost of each one
• input and store a customer’s details and the services they require
• calculate the total cost
• display the itemised bill including the total cost and the unique number of the bill
• repeat as required.
Task 3 – providing statistics about the services
Excluding the basic window clean and the additional windows, find the most popular service and
the least popular service. For these two services, display the service name, whether it was the most
or least popular and the number of times each service was used as a percentage of the total bills
stored.
1 All variables, constants and other identifiers must have meaningful names.
(a) (i) Identify one constant that you could have used for Task 1.
Value .................................................................................................................................
Reason ..............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(ii) Describe the array that you set up in Task 1 to record the customer details.
Include the name, data type and sample data for the array in your description.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(b) Explain how your program allowed only two floors or three floors to be chosen but not both.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(c) Write an algorithm for the part of Task 2 that calculates the total cost of the bill.
Assume that the customer details and services required have already been input.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
© UCLES 2022 0478/23/O/N/22
5
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
© UCLES 2022 0478/23/O/N/22 [Turn over
6
Any programming statements that you include in your answer must be fully explained.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
Section B
02 Reading[Count] 0
03 NEXT Count
04 Count 1
06 INPUT Value
07 REPEAT
09 THEN
11 ELSE
12 Reading[Value] .......................................................................................
13 Count = Count + 1
14 ENDIF
15 IF Count <= 50
16 THEN
18 .................................................................................................................................
19 ENDIF
21 Count 35
22 REPEAT
24 Count ...................................................................................................................
(b) Describe how the algorithm could be changed to output the number of times each value has
been input, starting with the highest value.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
3 A check digit is to be used to validate an identification number on input. The identification number
contains five digits and the check digit.
The check digit is calculated by adding up the first five digits, dividing by 10 and taking the
remainder.
For example, 5 + 1 + 2 + 4 + 3 divided by 10 gives a remainder of 5 so the six-digit
identification number would be 512435
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
(ii) State which of these identification numbers have incorrect check digits.
A 123455
B 691400
C 722855
D 231200
...........................................................................................................................................
..................................................................................................................................... [2]
...........................................................................................................................................
...........................................................................................................................................
(b) (i) Describe an input error that would not be found using this check digit.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Describe a more suitable algorithm to calculate the check digit for this identification
number.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
© UCLES 2022 0478/23/O/N/22
11
(c) Identify two other validation checks that could be used when inputting this identification
number.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
4 This algorithm makes sure that there are enough wheelbarrows in stock.
START
Stock 10
Total 0
INPUT Sale
Yes
Is Sale = OUTPUT Total
"N"?
No
STOP
Stock Stock – 1
Yes OUTPUT
Is Stock
< 5? "Add new stock"
No
(a) Complete the trace table for the algorithm using this input data:
[4]
(b) Explain how you could extend the algorithm to allow for the sale of more than one wheelbarrow
at a time.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
5 A database table, MUSEUM, is used to keep a record of items in the museum. The table has
these fields:
• ItemCode – code for each type of item, for example ART0005
• Description – brief description of each item, for example gold coin
• InStore – whether the item is in store or not, for example Y
• Century – century when item made, for example 18
• Country – country of origin, for example China.
(a) Identify which field you would choose for the primary key.
Field ..........................................................................................................................................
Reason .....................................................................................................................................
...................................................................................................................................................
[2]
(b) Complete the query-by-example grid to display only the description and the country of origin
for those items not in store.
Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
BLANK PAGE
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.