IGCSE Computer Science 0478 Paper 22, Oct/Nov 2025

Question paper and mark scheme75 marks7 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 · Oct/Nov 2025

Download PDF
2

This pseudocode algorithm is intended to input a first name from a user and search for it in a two-dimensional (2D) array. If the name is found, the algorithm outputs all the remaining details for that name. The algorithm will continue to allow other names to be entered for searching, until the user input stops it. 01 DECLARE Contacts : ARRAY[1:500, 1:4] OF REAL 02 DECLARE Row : INTEGER 03 DECLARE Column : INTEGER 04 DECLARE Continue : BOOLEAN 05 DECLARE Stop : BOOLEAN 06 DECLARE FirstName : STRING 07 Continue ← TRUE 08 Stop ← FALSE 09 WHILE Continue 10 Row ← 1 11 OUTPUT "Enter a first name " 12 OUTPUT FirstName 13 REPEAT 14 IF Contacts[Row, 1] = FirstName 15 THEN 16 FOR Column ← 1 TO 4 17 OUTPUT Contacts[Row, 1] 18 NEXT Column 19 Stop ← TRUE 20 ELSE 21 Row ← Row + 1 22 ENDIF 23 NEXT Stop OR Row > 500 24 OUTPUT "Search for another name? (Y or N)" 25 INPUT Answer 26 IF Answer = 'N' OR Answer = 'n' 27 THEN 28 Continue ← TRUE 29 ENDIF 30 ENDWHILE

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(i)

A procedure NewData allows data for new contacts to be entered and stored in the 2D array Contacts[]. A parameter, Number, is used to pass values from the main algorithm to the procedure for the number of new contacts. Next, four pieces of contact data for each new contact are entered and stored at the start of the array. Complete the pseudocode for PROCEDURE NewData PROCEDURE NewData(....................................................................................................) FOR Row ← 1 TO .................................................................................................. FOR Column ← 1 TO 4 INPUT ..................................................................................................... ........................................................................................................................... ................................................................................................................................... ENDPROCEDURE

[4]
b(ii)

Write the pseudocode to input the number of new contacts and to use procedure NewData. A variable declaration is not required.

[2]
c(i)

A first name is used as the search key in the algorithm on page 2. If the name is found, all the data for that name is output and the algorithm stops searching. Explain why the given algorithm may not always give the expected results.

[2]
c(ii)

Explain how you could improve the algorithm so that the search is more likely to find the required results.

[2]
3

A program is written that will only accept values between –99.99 and +99.99, inclusive. The program is to be tested. The table, when completed, shows appropriate test data that matches the type of test data and purpose of the test data. Complete the table by inserting the missing information. Test data | Type of test data | Purpose of test data 0 | | ............................................................................................... | | ............................................................................................... | boundary | ............................................................................................... | | ............................................................................................... | | to make sure that the program rejects data that is outside acceptable limits

[6]
4
Figure 1 of 1 for question 4
a

A length check is a type of validation check. State the purpose of a length check.

[1]
b

An email address can be validated by checking that it contains an @ symbol. Write the pseudocode for an algorithm that will allow an email address to be input and check whether or not it contains an @ symbol. Output a suitable message with the result. Use the string function SUBSTRING(EmailAddress, Start, 1) in your solution to return a string of length 1 character, starting at position Start, where EmailAddress is the identifier representing your input. You do not need to declare any variables for this algorithm, but variables must be initialised as necessary. Assume there will not be more than one @ symbol in the email address input.

[6]
5

This flowchart represents an algorithm.

Figure 1 of 1 for question 5
a

The first data row of the trace table shows the values currently stored in CodeStore[] Complete the trace table for the algorithm, using the input data: 7686, Face, Speed, 432U, Yp79

[6]
b

Describe the processes in the algorithm on page 6.

[3]
c

The algorithm on page 6 requires the array CodeStore[] to be declared as a one-dimensional (1D) string array with six elements that are initially set to the null string "". Write the pseudocode required to declare and initialise the array CodeStore[] You do need to declare any variables used.

[4]
6

Consider the logic expression: X = (J XOR NOT K) NAND NOT L

a

Draw a logic circuit for the logic expression. Each logic gate must have a maximum of two inputs. Do not simplify the logic expression.

[4]
b

Complete the truth table for the given logic expression.

[4]
7

A database table WATERFOWL stores some details of a range of birds found in the UK that live on or near water. The length and wingspan dimensions are in centimetres and the typical lifespan is in years. Species | Family | Length | Wingspan | CoastalHabitat | Lifespan Barnacle goose | Goose | 63.5 | 130.0 | FALSE | 14 Bewick's swan | Swan | 120.2 | 190.5 | TRUE | 8 Brent goose | Goose | 58.0 | 94.3 | TRUE | 11 Canada goose | Goose | 78.5 | 160.0 | FALSE | 6 Eider | Duck | 58.0 | 94.5 | TRUE | 8 Goldeneye | Duck | 44.5 | 72.1 | TRUE | 6 Goosander | Duck | 63.3 | 90.0 | TRUE | 7 Long-tailed duck | Duck | 44.0 | 76.6 | TRUE | 5 Mallard | Duck | 59.7 | 90.8 | FALSE | 3 Mute swan | Swan | 150.0 | 220.2 | FALSE | 10 Pink-footed goose | Goose | 69.6 | 150.0 | TRUE | 8 Pintail | Duck | 60.0 | 88.6 | TRUE | 3 Smew | Duck | 41.5 | 62.1 | FALSE | 7 White-fronted goose | Goose | 71.5 | 140.0 | FALSE | 6 Whooper swan | Swan | 150.0 | 230.0 | TRUE | 9

a

State the purpose of a primary key in a database table.

[1]
b

Complete the table for each of the given data types, to identify one field from the table WATERFOWL that is most likely to use it. Each field must be different. Data type | Field Boolean | Integer | Real | Text |

[2]
c

Give the output that would be produced by the structured query language (SQL) statement: SELECT Species, Length, Wingspan FROM WATERFOWL WHERE Family = "Swan" ORDER BY Lifespan;

[3]
d

Complete the SQL statement to list only the species, family and lifespan of all waterfowl whose typical lifespan is at least 10 years, sorted in order of species. SELECT .....................................................................................................................................

[4]
8

A program is required to test the fairness of the random number generator. The one-dimensional (1D) array RandomNumber[] is used to store 100000 random integers. The two-dimensional (2D) array CountedNumber[] is used to store the integers 1 to 10, inclusive, and the frequency of each integer (the number of times each integer was generated). Write a program that meets the following requirements: • Generate 100000 random integers between 1 and 10, inclusive. • Store each integer in the appropriate array. • Calculate the frequency of each of the integers 1 to 10 and store these values in the appropriate array. • Sort the contents of the counted number array in descending order of frequency. • Calculate the chance of generating each of the integers 1 to 10, rounded to four decimal places. Use the formula: chance = frequency / 100000 • Output each of the integers 1 to 10 in the order they are stored in the counted number array, along with the chance of generating them. The following is an example of an algorithm that sorts a 2D array in an ascending order: F ← TRUE WHILE F DO F ← FALSE FOR I ← 1 TO 9 IF A[I, 2] > A[I + 1, 2] THEN T1 ← A[I, 1] T2 ← A[I, 2] A[I, 1] ← A[I + 1, 1] A[I, 2] ← A[I + 1, 2] A[I + 1, 1] ← T1 A[I + 1, 2] ← T2 F ← TRUE ENDIF NEXT I ENDWHILE You must use pseudocode or program code and add comments to explain how your code works. All arrays, variables or constants used must be declared for this algorithm. All inputs and outputs must contain suitable messages.

[15]

Mark scheme

0478/22 · Oct/Nov 2025

Download PDF

2a · 5 marks

  • 1 mark

    Line 01 / DECLARE Contacts : ARRAY[1:500, 1:4] OF REAL should be DECLARE Contacts : ARRAY[1:500, 1:4] OF STRING

  • 1 mark

    Line 12 / OUTPUT FirstName should be INPUT FirstName

  • 1 mark

    Line 17 / OUTPUT Contacts[Row, 1] should be OUTPUT Contacts[Row, Column]

  • 1 mark

    Line 23 / NEXT Stop OR Row > 500 should be UNTIL Stop OR Row > 500

  • 1 mark

    Line 25 / 26 / Answer variable not declared should be DECLARE Answer : CHAR before line 25

  • 1 mark

    Line 28 / Continue  TRUE should be Continue  FALSE

2b(i) · 4 marks

  • 1 mark

    Appropriate parameter in PROCEDURE line

  • 1 mark

    Correct index outer loop termination value; must use Number as stated in question

  • 1 mark

    Correct array reference in INPUT

  • 1 mark

    Correct termination of both loops.

2b(ii) · 2 marks

  • 1 mark

    Correct input statement

  • 1 mark

    Correct call statement for NewData

2c(i) · 2 marks

  • 1 mark

    There may be more than one person with the given first name // The name may not exist/found in the array

  • 1 mark

    The search will stop at the first occurrence and output the data for the wrong person

  • 1 mark

    If the name is not present there could be no output / the loop will continue.

2c(ii) · 2 marks

  • 1 mark

    Introduce additional search criteria into the algorithm to make the search more specific to each person in the array

  • 1 mark

    … such as the last name to go with the first name // … such as some form of ID number / date of birth / contact number / post code

  • 1 mark

    The algorithm should be able to search the whole array to find all available matches

  • 1 mark

    … by removing the stop variable

  • 1 mark

    Use selection to confirm the name has not been found in the whole array

  • 1 mark

    If the name is not present, output an appropriate message.

3 · 6 marks

  • 1 mark

    normal

  • 1 mark

    accepts data that is in range

  • 1 mark

    boundary

  • 1 mark

    rejects data that is on the wrong side of the boundary

  • 1 mark

    abnormal

  • 1 mark

    rejects data that is outside acceptable limits

4a · 1 mark

  • 1 mark

    To check that the data entered has the required number of characters.

4b · 6 marks

  • 1 mark

    Initialisation of variables – start location for checking and flag, if used

  • 1 mark

    Input of email address into appropriate variable

  • 1 mark

    Working condition-controlled loop present

  • 1 mark

    Correct use of SUBSTRING

  • 1 mark

    Use of condition for checking value extracted from SUBSTRING / '@'

  • 1 mark

    Appropriate action if '@' found – loop termination

  • 1 mark

    Appropriate action if '@' NOT found – check the next character and loop termination if no more characters

  • 1 mark

    Output that only shows when the email address is valid or invalid. Both cases required.

5a · 6 marks

  • 1 mark

    Correct Code column

  • 1 mark

    Correct Store column

  • 1 mark

    Correct Count column

  • 1 mark

    First four CodeStore columns left unchanged

  • 1 mark

    Correct CodeStore[5] and CodeStore[6] columns

  • 1 mark

    Correct OUTPUT column

5b · 3 marks

  • 1 mark

    Checks that the length of the code input is 4 characters.

  • 1 mark

    Checks the code against the array contents to see if it has been used before (in the last 6 codes)

  • 1 mark

    If the code passes the tests, it is stored in the array

  • 1 mark

    Stores the code in the lowest available index

  • 1 mark

    Checks that the code store isn’t full before storing a new code // Outputs a code store is full message if appropriate // Algorithm continues until the code store is full.

5c · 4 marks

  • 1 mark

    Declaration of array using correct name and data type

  • 1 mark

    Declaration of loop counter

  • 1 mark

    Use of appropriate loop for six iterations (allow any type of loop)

  • 1 mark

    Assignment of all array elements to null string (using loop counter as array index)

6a · 4 marks

  • 1 mark

    Correct XOR gate with inputs J and NOT K

  • 1 mark

    Correct NOT gate on input K

  • 1 mark

    Correct NOT gate on input L

  • 1 mark

    Correct NAND gate connected to output X

6b · 4 marks

  • 4 marks

    8 correct outputs in column X (0, 1, 1, 1, 1, 1, 0, 1)

7a · 1 mark

  • 1 mark

    It is used to uniquely identify records

7b · 2 marks

  • 2 marks

    All four fields correctly identified (Boolean: CoastalHabitat, Integer: Lifespan, Real: Length // Wingspan, Text: Species // Family)

7c · 3 marks

  • 1 mark

    Correct data – spelt correctly

  • 1 mark

    Correct layout – three columns, with no additional punctuation

  • 1 mark

    Correct order (vertical and horizontal)

7d · 4 marks

  • 1 mark

    SELECT Species, Family, Lifespan

  • 1 mark

    FROM WATERFOWL

  • 1 mark

    WHERE Lifespan >= 10

  • 1 mark

    ORDER BY Species;

8 · 15 marks

  • 9 marks

    AO2: Apply knowledge and understanding of the principles and concepts of computer science to a given context, including the analysis and design of computational or programming problems (maximum 9 marks)

  • 6 marks

    AO3: Provide solutions to problems by: evaluating computer systems, making reasoned judgements, presenting conclusions (maximum 6 marks)

Questions

  1. 2
    Question 215 marks
    Mark scheme ›
  2. 3
    Question 36 marks
    Mark scheme ›
  3. 4
    Question 47 marks
    Mark scheme ›
  4. 5
    Question 513 marks
    Mark scheme ›
  5. 6
    Question 68 marks
    Mark scheme ›
  6. 7
    Question 710 marks
    Mark scheme ›
  7. 8
    Question 815 marks
    Mark scheme ›

More 0478 papers

Other papers from Oct/Nov 2025

Solve it on ExamPalStart