IGCSE Computer Science 0478 Paper 21, May/June 2026

Question paper and mark scheme75 marks11 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/21 · May/June 2026

Download PDF
2

Identify four operators that are not arithmetic operators from the list. / > <= + * ^ AND DIV MOD NOT 1 ............................................................... 2 ............................................................... 3 ............................................................... 4 ...............................................................

[4]
3

Complete the table by writing the most appropriate data type for each variable described.

variabledescriptionexample datadata type
Agethe age of the student16
TelephoneNumberthe telephone number of the student+44 7846398573
Teenagerwhether the student is a teenager or notTRUE
[3]
4

The following pseudocode algorithm uses a bubble sort to sort the array Names[50] Complete the algorithm. Last ← ............................................. REPEAT Swap ← ............................................. FOR ............................................. ← 1 TO Last - 1 IF Names[Index] > Names[Index + 1] THEN Temp ← Names[Index] Names[Index] ← Names[Index + 1] Names[Index + 1] ← Temp Swap ← TRUE ENDIF NEXT Index Last ← Last - 1 UNTIL ............................................. Swap OR Last = 1

[4]
5

A computer system automatically creates usernames for new users. A new user enters their first name and their last name. The system: • takes the first letter of the first name • takes the first two letters of the last name • converts all the letters to upper case • generates a random whole number between 1 and 1000 inclusive. For the following example: The first name is Muhammed The last name is Hann The generated number is 492 The username will be MHA492

a

Write the pseudocode to generate a whole random number between 1 and 1000 inclusive and store it in the variable GeneratedNumber

[2]
b

The last name is input into the variable LastName Write the pseudocode to: • take the first two letters from LastName • convert the letters to upper case • store the result in the variable Temp

[3]
c

The new username is stored in the variable NewUsername Write the pseudocode to store NewUsername to the file Username.txt

[3]
d

Identify and describe verification checks that could be applied to the inputs of the first name and the last name of the user.

[4]
6

Give programming examples for a count-controlled loop and a post-condition loop. Describe each of the loops. count-controlled loop example ......................................................................................................... description ........................................................................................................................................ .......................................................................................................................................................... .......................................................................................................................................................... post-condition loop example ............................................................................................................ description ........................................................................................................................................ .......................................................................................................................................................... ..........................................................................................................................................................

[4]
7

An algorithm has been written in pseudocode for a user to repeatedly input positive whole numbers and store them in an array called Values[] until –1 is input or until the array is full. The algorithm outputs the average of the numbers to 2 decimal places. 01 DECLARE Counter : INTEGER 02 DECLARE Total : INTEGER 03 DECLARE Average : INTEGER 04 DECLARE Values : ARRAY[1:100] OF INTEGER 05 Counter ← 1 06 Total ← 0 07 OUTPUT "Please enter a positive whole number or -1 " 08 INPUT Number 09 WHILE Number = -1 AND Counter <= 100 DO 10 Values[Counter] ← Number 11 Total ← Total + 1 12 Counter ← Counter + 1 13 INPUT Number 14 ENDWHILE 15 Counter ← Counter - 1 16 Average ← Counter / Total 17 OUTPUT "The average is ", ROUND(Average, 2) Identify the line numbers of four 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 ......................................................................................................................................... ..........................................................................................................................................................

[4]
Figure 1 of 1 for question 7
8

Consider the logic circuit:

a

Write the logic expression for the given logic circuit.

[3]
b

Complete the truth table for the given logic circuit.

ABCworking spaceX
000
001
010
011
100
101
110
111
[4]
9

A swimming club wants to set up a new database table to store details of the members of the club and the maximum distance each member swam in metres. The table is called SWIMMERS and will contain these fields: • Distance – distance the member swam, for example 1500 • Date – date the member swam the distance • Time – time taken to swim the distance • MemberID – the code to identify a member, for example TH749 • MemberName – name of the member.

a(i)

State why MemberName would not be appropriate for a primary key.

[1]
a(ii)

Give the name of the most appropriate field for the primary key.

[1]
b

Complete the table to identify the most appropriate data type for these fields in the table SWIMMERS. Each data type must be different.

fielddata type
Distance
Date
MemberID
[2]
c

Complete the structured query language (SQL) statement to display only the names of the members who swam a distance of 1500 metres or more. SELECT ..................................................................................................................................... FROM ......................................................................................................................................... WHERE ....................................................................................................................................... ................................................................................................................................................. ;

[3]
10
Figure 1 of 1 for question 10
a

Draw a flowchart to input six whole numbers and output the highest. You do not need to validate the inputs.

[6]
b

Describe how the flowchart could be changed to only accept positive whole numbers.

[3]
11

The function Power(FirstNumber, SecondNumber) returns the value of FirstNumber raised to the power of SecondNumber. FirstNumber and SecondNumber are integers. Write pseudocode statements to: • define the function • call the function with the variables A and B and store the return value in the variable Value function definition .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... function call .......................................................................................................................................................... ..........................................................................................................................................................

[5]
12

A weather monitoring station records the number of minutes of sunshine for each day of a month. The one-dimensional (1D) array Sunshine[] is used to store the number of minutes of sunshine for each day. The index of the array represents the day. The one-dimensional (1D) array MonthDays[] contains the number of days in each month. The index of the array represents the month. In this array, 28 is stored in index 2 for the month of February. However, there are 29 days in February in a leap year. In this program, a leap year is a year that divides by 4 with no remainder. For example, 2026 is not a leap year but 2028 will be a leap year. Write a program that meets the following requirements: • allows the user to input a year, calculates whether it is a leap year and updates the number of days in February as appropriate • allows a user to input the name of one of the first three months of the year: January, February or March • allows a user to input the number of minutes of sunshine for each day of the month and validates the input • calculates the total amount of sunshine for the month in hours and minutes • finds the highest amount of daily sunshine for the month • outputs the: ◦ year ◦ month ◦ total amount of sunshine for the month in hours and minutes ◦ the highest amount of daily sunshine for the month. You must use pseudocode or program code and add comments to explain how your code works. Do not declare any arrays or variables; assume that this has already been done. All inputs and outputs must contain suitable messages.

[15]

Mark scheme

0478/21 · May/June 2026

Download PDF

2 · 4 marks

  • 1 mark

    1 >

  • 1 mark

    2 <=

  • 1 mark

    3 AND

  • 1 mark

    4 NOT

3 · 3 marks

  • 1 mark

    Age: integer

  • 1 mark

    TelephoneNumber: string

  • 1 mark

    Teenager: Boolean

4 · 4 marks

  • 1 mark

    50

  • 1 mark

    FALSE

  • 1 mark

    Index

  • 1 mark

    NOT // False =

5a · 2 marks

  • 1 mark

    correct use of RANDOM() * 999 + 1

  • 1 mark

    assignment to GeneratedNumber in attempt to randomise number

5b · 3 marks

  • 1 mark

    correct use of UCASE

  • 1 mark

    correct use of SUBSTRING

  • 1 mark

    assignment to Temp of attempt to extract from LastName and/or convert to upper case

5c · 3 marks

  • 1 mark

    Correct opening of file

  • 1 mark

    Correct writing to file

  • 1 mark

    Correct closing of file

5d · 4 marks

  • 1 mark

    Double entry identification

  • 1 mark

    enter data twice and only accept identical value/automatic check by computer

  • 1 mark

    Visual check identification

  • 1 mark

    looks at the data that has been entered and confirm it matches

6 · 4 marks

  • 1 mark

    FOR (Loop) identification

  • 1 mark

    iterates a pre-determined number of times

  • 1 mark

    REPEAT (UNTIL) identification

  • 1 mark

    checks the condition at the end of the loop//will always iterate once

7 · 4 marks

  • 1 mark

    Line 3 – should be DECLARE Average : REAL

  • 1 mark

    Line 9 – should be WHILE Number <> -1 AND Counter <= 100 DO

  • 1 mark

    Line 11 – should be Total ← Total + Number // Total ← Total + Values[Counter]

  • 1 mark

    Line 16 – should be Average ← Total/Counter

8a · 3 marks

  • 1 mark

    A XOR B

  • 1 mark

    B AND NOT C

  • 1 mark

    correct expression: X = (A XOR B) OR (B AND NOT C) // X = A XOR B OR B AND NOT C

8b · 4 marks

  • 4 marks

    4 marks for 8 correct outputs (3 marks for 6/7 correct outputs, 2 marks for 4/5 correct outputs, 1 mark for 2/3 correct outputs)

9a(i) · 1 mark

  • 1 mark

    As MemberName may be repeated/not unique

9a(ii) · 1 mark

  • 1 mark

    MemberID

9b · 2 marks

  • 2 marks

    One mark for two correct data types, two marks for three correct data types: Distance (Integer //Real//text//alphanumeric), Date (Date/Time //text//alphanumeric), MemberID (Text //alphanumeric)

9c · 3 marks

  • 1 mark

    SELECT MemberName

  • 1 mark

    FROM SWIMMERS

  • 1 mark

    WHERE Distance >= 1 500;

10a · 6 marks

  • 1 mark

    initialising Max/highest and/or Count

  • 1 mark

    input of number

  • 1 mark

    checking if number greater than Max / adjacent array elements / numbers with correct labels

  • 1 mark

    updating Max or Count

  • 1 mark

    checking number of entries is equal to 6 // entry of six numbers

  • 1 mark

    outputting correct Max value

  • 1 mark

    complete flow lines using arrows for attempt at finding highest number; flow chart must terminate at stop/end

10b · 3 marks

  • 1 mark

    adding a new decision box with IS Number > 0 ? …

  • 1 mark

    … after INPUT Number

  • 1 mark

    looping back to before INPUT Number

11 · 5 marks

  • 1 mark

    defining FUNCTION Power with ENDFUNCTION and RETURNS INTEGER/REAL

  • 1 mark

    defining the parameters correctly

  • 1 mark

    correct calculation

  • 1 mark

    return the calculated value

  • 1 mark

    correct function call

12 · 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 (max 9 marks)

  • 6 marks

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

Questions

  1. 2
    Question 24 marks
    Mark scheme ›
  2. 3
    Question 33 marks
    Mark scheme ›
  3. 4
    Question 44 marks
    Mark scheme ›
  4. 5
    Question 512 marks
    Mark scheme ›
  5. 6
    Question 64 marks
    Mark scheme ›
  6. 7
    Question 74 marks
    Mark scheme ›
  7. 8
    Question 87 marks
    Mark scheme ›
  8. 9
    Question 97 marks
    Mark scheme ›
  9. 10
    Question 109 marks
    Mark scheme ›
  10. 11
    Question 115 marks
    Mark scheme ›
  11. 12
    Question 1215 marks
    Mark scheme ›

More 0478 papers

Other papers from May/June 2026

Solve it on ExamPalStart