IGCSE Computer Science 0478 Paper 22, May/June 2025

Question paper and mark scheme75 marks9 questions

Solve it on ExamPal

Practise

Untimed. Write on the paper and check as you go.

Start

Exam

Timed, with a clock you set, like sitting the real paper.

Start

Opens full screen.

Opening the question paper

Read as textThe questions and the mark scheme as plain text. Easier to read on a phone.

Question paper

0478/22 · May/June 2025

Download PDF
2

A fence measuring 2 metres in height and 20 metres in length needs painting. The area of the fence needs to be calculated so that enough paint for the job is purchased. After the task is decomposed, there are three component parts: input, process and output. Three component parts and four example descriptions are shown. Draw one line from each component part to the most appropriate relevant description. Not all descriptions will be used.

[3]
Figure 1 of 1 for question 2
3

A range check is used to validate that the input temperature is an integer between –100 and 0, inclusive. Suggest suitable normal, abnormal, extreme and boundary test data to test if this validation check is working correctly. Normal test data ............................................................................................................................... Abnormal test data ........................................................................................................................... Extreme test data ............................................................................................................................. Boundary test data ...........................................................................................................................

[4]
4
a

State one reason for using a verification check when inputting data.

[1]
b

Write the pseudocode for an algorithm to perform a double entry verification check, using the following criteria: • Input 10 numbers and store them in the array Numbers[] • Input the same 10 numbers again; as each number is input, compare it with its corresponding number in the array Numbers[] ◦ if the numbers match, move on to the next number ◦ if the numbers do not match, display both numbers and ask for the number to be re-entered ◦ store the re-entered number in the corresponding array location and move on to the next number. • When all the numbers have been checked, display a message to say the check has been completed. You do not need to declare any arrays or variables for this algorithm.

[6]
5

This pseudocode algorithm should allow 500 names of people and their heights to be entered and stored in two one-dimensional (1D) arrays. The name of a person and the height of that person are in the same index in both the Names[] and the Heights[] arrays. The algorithm performs as follows: • at the start, the following data is entered: ◦ name of person ◦ height of person in cm • the data is stored in the relevant arrays • the heights of the people are totalled • the shortest person is found • at the end, the following is output: ◦ name of shortest person ◦ height of shortest person ◦ average height of all 500 people. 01 DECLARE Names : ARRAY[1:500] OF REAL 02 DECLARE Heights : ARRAY[1:500] OF REAL 03 DECLARE Shortest : REAL 04 DECLARE Total : REAL 05 DECLARE Counter : INTEGER 06 DECLARE Index : INTEGER 07 Shortest ← 500 08 Index ← 0 09 Total ← 100 10 FOR Counter ← 1 TO 500 11 INPUT Names[Index] 12 INPUT Heights[Counter] 13 Total ← Counter + Heights[Counter] 14 IF Heights[Counter] < Shortest 15 THEN 16 Shortest ← Heights[Counter] 17 Index ← Counter 18 ENDIF 19 NEXT Counter 20 OUTPUT "The shortest height is ", Heights 21 OUTPUT "The shortest person is ", Names[Index] 22 OUTPUT "The average height is ", Total / 500

Figure 1 of 1 for question 5
a

Identify the line numbers of five errors in the pseudocode and suggest a correction for each error. Error 1 line number .................................. Correction ................................................................................................................................. ................................................................................................................................................... Error 2 line number .................................. Correction ................................................................................................................................. ................................................................................................................................................... Error 3 line number .................................. Correction ................................................................................................................................. ................................................................................................................................................... Error 4 line number .................................. Correction ................................................................................................................................. ................................................................................................................................................... Error 5 line number .................................. Correction ................................................................................................................................. ...................................................................................................................................................

[5]
b

Write the pseudocode statement that will output the average height rounded to one decimal place.

[2]
c

Explain how you could change the corrected algorithm so that it will also: • find the height of the tallest person. • output the height of the tallest person at the end of the algorithm. Any program statements used must be fully explained.

[4]
6

This pseudocode is an algorithm. DECLARE Word : STRING DECLARE V1 : INTEGER DECLARE V2 : INTEGER DECLARE Number : INTEGER DECLARE Index : INTEGER DECLARE L1 : CHAR DECLARE L2 : CHAR DECLARE Continue : BOOLEAN INPUT Number FOR Index ← 1 TO Number INPUT Word Continue ← TRUE V1 ← 1 V2 ← LENGTH(Word) WHILE Continue = TRUE AND V1 < V2 DO L1 ← SUBSTRING(Word, V1, 1) L2 ← SUBSTRING(Word, V2, 1) IF L1 <> L2 THEN Continue ← FALSE ELSE V1 ← V1 + 1 V2 ← V2 – 1 ENDIF ENDWHILE IF Continue = TRUE THEN OUTPUT "Successful" ELSE OUTPUT "NOT successful" ENDIF NEXT Index

a

Complete the trace table for the algorithm, using the input data: 2, RACECAR, TREAT

[6]
b

State the purpose of the algorithm on page 6.

[1]
c

Explain how the algorithm knows when all the letters in the word have been checked so that it can stop checking.

[3]
7

The flowchart shows an algorithm that is used to input 50 numbers. Each number is stored in the variable Value when it is input. Any number input that is less than or equal to –20 or greater than or equal to 50 is rejected and re-input. The accepted numbers are added together as they are entered and the total and average of these numbers are output at the end of the algorithm.

Figure 1 of 1 for question 7
a

Complete the flowchart.

[6]
b

Explain how you would alter the flowchart in 7(a) so that it will individually store each accepted value as it is entered and then output all the numbers, one after the other, outside of the loop that inputs values. You may include program statements or flowchart symbols in your answer, but they must be fully explained.

[4]
8
a

Draw the symbol for an XOR logic gate and complete the truth table for it. XOR logic gate symbol: Truth table: A B X 0 0 0 1 1 0 1 1

[2]
b(i)

Consider the logic rules in the following table: Input | Binary value | Description A | 0 | operator not present | 1 | operator present B | 0 | ignition key present | 1 | ignition key not present C | 0 | operator code correct | 1 | operator code not correct A crane is a machine with a long arm used to lift heavy objects. The crane will only move: • if the operator is present and • either the ignition key is present, or the operator code is correct. The crane moving is represented by X = 1. Write the logic expression for the crane moving. X = ...............................................................................................................................

[2]
b(ii)

Complete the truth table for the crane moving.

[4]
9

A database table, CapitalCity, stores data about capital cities from around the world. Field | Description Identification | a unique identifier Name | the name of the city Country | the name of the country in which the city is located Continent | the name of the continent in which the city is located Population | the number of people living in the city Founded | the year the city was founded AverageIncome | average income of the city’s population, in $, rounded to 2 decimal places Subway | whether or not the city has an underground railway system

a

Complete the table by writing one appropriate field from CapitalCity for each data type. Each field must be different. Data type | Field Boolean | integer | real | text |

[2]
b

Complete the structured query language (SQL) statement to list only the name, country and population of all the cities in CapitalCity from the continent of Asia. SELECT ..................................................................................................................................... .......................................................... CapitalCity WHERE ............................................................. = .................................................................. ;

[4]
10

A program is required to allow students to calculate the volume of a number of standard three-dimensional shapes. It will use functions to allow other shapes to be added in the future. Cuboid volume=base×depth×height Triangular prism volume=12×base×depth×height Sphere volume=43×Pi×radius×radius×radius Pi is a constant with value 3.142 Write a program that meets the following requirements: • Output a menu to ask the user for an input to indicate the shape for which a volume needs to be calculated, from the three shapes given or if they want to stop the program. The program must validate the input. • Input the data needed to calculate the volume of the chosen shape, based on the given formulae. • Create one function for each shape to calculate and return the volume using the given formulae. Each function uses the input data as parameters. • Output the volume in the main program, rounded to two decimal places. The program continues until the user inputs the stop option from the menu. You must use pseudocode or program code and add comments to explain how your code works. All variables and constants used must be declared for this algorithm. All inputs and outputs must contain suitable messages.

[15]
Figure 1 of 3 for question 10
Figure 2 of 3 for question 10
Figure 3 of 3 for question 10

Mark scheme

0478/22 · May/June 2025

Download PDF

2 · 3 marks

  • 1 mark

    process connects to 'The area of fence is calculated as 40 square metres.'

  • 1 mark

    output connects to 'The amount of paint required is 40 square metres.'

  • 1 mark

    input connects to 'the height of the fence the length of the fence'

  • 1 mark

    input connects to 'the colour of the paint'

3 · 4 marks

  • 1 mark

    Normal test data: −50 (any integer value between 0 and −100, inclusive)

  • 1 mark

    Abnormal test data: 50 (any value outside the range 0 and −100, inclusive, or any non-numeric input and non-integers

  • 1 mark

    Extreme test data: 0 // −100

  • 1 mark

    Boundary test data: 1 // 0 // −100 // −101

4a · 1 mark

  • 1 mark

    To check that the value entered has not changed on input.

4b · 6 marks

  • 1 mark

    MP1 At least one appropriate working loop

  • 1 mark

    MP2 First inputs of numbers all stored in array Numbers

  • 1 mark

    MP3 Correct second input made for each number

  • 1 mark

    MP4 Working selection statement to compare first and second inputs one at a time

  • 1 mark

    MP5 If numbers don't match, appropriate output, including both values input and a message requiring re-input

  • 1 mark

    MP6 New input stored in current array location (replacing original input)

  • 1 mark

    MP7 Final output confirming completion, outside loop.

5a · 5 marks

  • 1 mark

    Line 01 / DECLARE Names : ARRAY[1:500] OF REAL should be DECLARE Names : ARRAY[1:500] OF STRING

  • 1 mark

    Line 09 / Total <- 100 should be Total <- 0

  • 1 mark

    Line 11 / INPUT Names[Index] should be INPUT Names[Counter]

  • 1 mark

    Line 13 / Total <- Counter + Heights[Counter] should be Total <- Total + Heights[Counter]

  • 1 mark

    Line 20 / OUTPUT "The shortest height is ", Heights should be OUTPUT "The shortest height is ", Shortest or OUTPUT "The shortest height is ", Heights[Index]

5b · 2 marks

  • 1 mark

    MP1 Output statement with correct calculation of average, or use of a variable average.

  • 1 mark

    MP2 Correct use of ROUND function set to 1 decimal place.

5c · 4 marks

  • 1 mark

    MP1 Declaration of new variable for tallest person / largest value at start of algorithm

  • 1 mark

    MP2 Initialisation of largest variable to a low number e.g. 0

  • 1 mark

    MP3 New selection statement after input of height to compare it with current largest value

  • 1 mark

    MP4 If input of height is larger than current largest variable, it should become the new largest value

  • 1 mark

    MP5 Outside the loop, output the current value of the largest variable.

6a · 6 marks

  • 1 mark

    MP1 Correct Number and Index columns

  • 1 mark

    MP2 Correct Word column

  • 1 mark

    MP3 Correct Continue column

  • 1 mark

    MP4 Correct V1 and V2 column

  • 1 mark

    MP5 Correct L1 and L2 column

  • 1 mark

    MP6 Correct OUTPUT column

6b · 1 mark

  • 1 mark

    Finds words that read the same forwards and backwards.

6c · 3 marks

  • 1 mark

    MP1 Uses an index to mark the start and end of each word // uses V1 to mark the start of the word and V2 to mark the end

  • 1 mark

    MP2 After each check, these are moved to the next character in the word at each end of the word // V1 is incremented by 1 and V2 is decremented by 1 after each check.

  • 1 mark

    MP3 When the two indexes match or cross, the whole word has been checked // When V1 = V2 or V1 > V2, the whole word has been checked

  • 1 mark

    MP4 The algorithm will exit if it is found that two compared letters are not the same.

7a · 6 marks

  • 1 mark

    MP1 input Value

  • 1 mark

    MP2 correct check that Value is between −20 and 50, exclusive

  • 1 mark

    MP3 totalling values

  • 1 mark

    MP4 counting number of values

  • 1 mark

    MP5 checking Count = 50 / >= 50

  • 1 mark

    MP6 output of total and average

7b · 4 marks

  • 1 mark

    MP1 Change INPUT Value so that it saves values into an array

  • 1 mark

    MP2 … using the counter as the index

  • 1 mark

    MP3 Outside the (first) loop, set up a loop that will iterate 50 times

  • 1 mark

    MP4 Use an output statement inside the (second) loop to output the contents of the array, using the counter as the index.

8a · 2 marks

  • 1 mark

    XOR logic gate symbol

  • 1 mark

    Truth table:

    ABX
    000
    011
    101
    110

8b(i) · 2 marks

  • 1 mark

    MP1 A AND / MP3 A AND NOT B

  • 1 mark

    MP2 (NOT B OR NOT C) // NOT(B AND C) // (B NAND C) / MP4 OR A AND NOT C

8b(ii) · 4 marks

  • 4 marks
    ABCX
    0000
    0010
    0100
    0110
    1001
    1011
    1101
    1110

9a · 2 marks

  • 2 marks

    All four fields correctly identified: - Boolean: Subway - integer: Population // Founded // Identification - real: AverageIncome - text: Name // Country // Continent // Identification

9b · 4 marks

  • 1 mark

    MP1 All correct fields in SELECT

  • 1 mark

    MP2 Correct use of key word FROM

  • 1 mark

    MP3 Correct field in WHERE: Continent

  • 1 mark

    MP4 Correct criterion in WHERE: "Asia" // 'Asia'

10 · 15 marks

  • 15 marks

    Due to an issue with this question, the question has been removed from the question paper.

Questions

  1. 2
    Question 23 marks
    Mark scheme ›
  2. 3
    Question 34 marks
    Mark scheme ›
  3. 4
    Question 47 marks
    Mark scheme ›
  4. 5
    Question 511 marks
    Mark scheme ›
  5. 6
    Question 610 marks
    Mark scheme ›
  6. 7
    Question 710 marks
    Mark scheme ›
  7. 8
    Question 88 marks
    Mark scheme ›
  8. 9
    Question 96 marks
    Mark scheme ›
  9. 10
    Question 1015 marks
    Mark scheme ›

More 0478 papers

Other papers from May/June 2025

Solve it on ExamPalStart