Skip to content

Learn Extracted exam questions IGCSE Computer Science 0478 Computer Science March 2026 Question Paper 22

0478 Computer Science March 2026 Question Paper 22

Source PDF on the left, extracted YAML on the right. Compare numbering, marks, options and text.

1 1 mark multiple_choice p. 2 8.1

Tick ($\checkmark$) \textbf{one} box to identify the reason for applying a verification check to input data.

  1. A

    To make sure that all the data is in the correct range.

  2. B

    To make sure that all the data is accurate.

  3. C

    To make sure that no errors have been introduced during input.

  4. D

    To make sure that all the data is of the correct length.

2 short_answer p. 2
2a short_answer p. 2

Identify the type of validation check in each description. Each check must be different.

2ai 1 mark short_answer p. 2 8.1

A check to make sure that data input follows a set pattern such as two letters followed by three numbers.

2aii 1 mark short_answer p. 2 8.1

A check to make sure that only whole numbers can be input.

2b 3 marks short_answer p. 2 8.1

Explain the reasons why validation checks are necessary when data is input.

2c 6 marks long_answer p. 3 7

Write the pseudocode for an algorithm to perform a validation check on each number as it is input to meet the following criteria:

\begin{itemize} \item Input 20 numbers, one at a time. \item If a number is negative, store it in the current element of array \texttt{NegNumbers[]} \item If a number is \textbf{not} negative, ask for it to be input again until a negative number is input. \item When all 20 negative numbers have been stored, output a message to state the check has been completed. \end{itemize}

Use appropriate input prompts and output messages to make the requirements clear to the user.

Do \textbf{not} declare any arrays or variables for this algorithm.

3 6 marks long_answer p. 4 7

The program development life cycle is split into a number of stages.

Describe what happens during the analysis and design stages of the program development life cycle.

analysis \hrulefill

design \hrulefill

4 1 mark multiple_choice p. 4 7

Tick ($\checkmark$) \textbf{one} box to identify which of the following does \textbf{not} help to create a maintainable program.

  1. A

    Use meaningful identifiers for variable names.

  2. B

    Remove blank lines to make the program code shorter.

  3. C

    Use procedures and functions.

  4. D

    Use the commenting feature provided by the programming languages.

5 short_answer p. 6

This pseudocode algorithm is intended to sort 200 names in ascending order, using a bubble sort. The last names and first names are stored in separate columns of a two-dimensional (2D) array. The last names are stored in column 1 of the array.

\begin{alltt} 01 // The array Names[] has already been declared as 02 // ARRAY[1:200, 1:2] OF STRING and it is already populated 03 DECLARE Row : STRING 04 DECLARE Temp1 : STRING 05 DECLARE Temp2 : STRING 06 DECLARE Swap : BOOLEAN 07 Swap <- FALSE 08 WHILE NOT Swap DO 09 Swap <- FALSE 10 FOR Row <- 2 TO 199 11 IF Names[Row, 1] > Names[Row + 1, 1] 12 THEN 13 Temp1 <- Names[Row, 1] 14 Temp2 <- Names[Row, 2] 15 Names[Row, 1] <- Names[Row + 1, 1] 16 Names[Row, 1] <- Names[Row + 1, 2] 17 Names[Row + 1, 1] <- Temp1 18 Names[Row + 1, 2] <- Temp2 19 Swap <- FALSE 20 ENDIF 21 NEXT Column 22 ENDWHILE \end{alltt}

5a 5 marks short_answer p. 6 7

Identify the line numbers of five errors in the pseudocode and suggest corrections.

error 1 line number \hrulefill

correction \hrulefill

error 2 line number \hrulefill

correction \hrulefill

error 3 line number \hrulefill

correction \hrulefill

error 4 line number \hrulefill

correction \hrulefill

5b 4 marks long_answer p. 7 8.2

Write the pseudocode for an algorithm, using nested iteration, to output the contents of \texttt{Names[]}

5c 2 marks short_answer p. 7 7

Describe a possible problem with the algorithm that could mean the names are not sorted accurately.

6 short_answer p. 8

This flowchart represents an algorithm.

6a 5 marks short_answer p. 9 7

Complete the trace table for the algorithm, using the given sentence.

Note: the start position of the sentence is index 1.

\begin{tabular}{|l|c|c|c|c|c|} \hline \textbf{Sentence} & \textbf{SentLength} & \textbf{LetterNo} & \textbf{Start} & \textbf{Word} & \textbf{OUTPUT} \ \hline Computing is fun & 16 & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline & & & & & \ \hline \end{tabular}

6b 3 marks short_answer p. 9 7

Explain the purpose of the algorithm shown by the flowchart.

6c 3 marks short_answer p. 10 7

As currently written, the algorithm may be difficult to understand if it was used as a program.

Identify \textbf{three} improvements that could be made to the algorithm to make it more user friendly.

7 short_answer p. 11

Consider the logic expression:

$$X = (\text{A NAND NOT B) XOR (A NOR C)}$$
7a 4 marks short_answer p. 11 10

Draw a logic circuit for this logic expression.

Each logic gate must have a maximum of \textbf{two} inputs.

Do \textbf{not} simplify the logic expression.

7b 4 marks short_answer p. 11 10

Complete the truth table from the given logic expression.

\begin{tabular}{|c|c|c|c|} \hline \textbf{A} & \textbf{B} & \textbf{C} & \textbf{X} \ \hline 0 & 0 & 0 & \hrulefill \ \hline 0 & 0 & 1 & \hrulefill \ \hline 0 & 1 & 0 & \hrulefill \ \hline 0 & 1 & 1 & \hrulefill \ \hline 1 & 0 & 0 & \hrulefill \ \hline 1 & 0 & 1 & \hrulefill \ \hline 1 & 1 & 0 & \hrulefill \ \hline 1 & 1 & 1 & \hrulefill \ \hline \end{tabular}

8 short_answer p. 12

A database table \texttt{NATIONAL_TREES} stores details of the national trees of some countries from around the world.

\begin{tabular}{|l|l|l|l|l|} \hline \textbf{IDCode} & \textbf{Country} & \textbf{Continent} & \textbf{CommonName} & \textbf{ScientificName} \ \hline EU121 & Albania & Europe & Olive & Olea europaea \ \hline OC235 & Australia & Oceania & Golden wattle & Acacia pycnantha \ \hline NO126 & The Bahamas & North America & Lignum vitae & Guaiacum sanctum \ \hline AS534 & Bangladesh & Asia & Mango tree & Mangifera indica \ \hline SO326 & Brazil & South America & Brazilwood & Caesalpinia echinata \ \hline NO124 & Canada & North America & Maple & Acer \ \hline EU321 & Cyprus & Europe & Golden oak & Quercus alnifolia \ \hline NA456 & Dominican Republic & North America & West Indian mahogany & Swietenia mahagoni \ \hline EU652 & Finland & Europe & Silver birch & Betula pendula \ \hline AS222 & India & Asia & Indian banyan & Ficus benghalensis \ \hline NO232 & Jamaica & North America & Blue mahoe & Talipariti elatum \ \hline AF875 & Madagascar & Africa & Baobab & Adansonia \ \hline OC123 & New Zealand & Oceania & Silver fern & Cyathea dealbata \ \hline AS498 & Philippines & Asia & Narra & Pterocarpus indicus \ \hline AF501 & South Africa & Africa & Real yellowwood & Podocarpus latifolius \ \hline SO522 & Venezuela & South America & Araguaney & Tabebuia chrysantha \ \hline \end{tabular}

8a 2 marks short_answer p. 12 9

State the number of fields and records in this database table.

fields \hrulefill records \hrulefill

8b 1 mark short_answer p. 12 9

The data in both \texttt{IDCode} and \texttt{Country} fields are unique in the database table.

State \textbf{one} reason why \texttt{IDCode} would make a better primary key than \texttt{Country}

8c 3 marks short_answer p. 13 9

Give the output that would be produced by the structured query language (SQL) statement:

\begin{alltt} SELECT IDCode, Country, CommonName FROM NATIONAL_TREES WHERE Continent = "Europe"; \end{alltt}

8d 5 marks short_answer p. 13 9

Complete the SQL statement to list only the country, common name and scientific name of the national trees listed for North America, in alphabetical order of their common names.

\begin{alltt} SELECT \hrulefill \newline FROM \hrulefill \newline WHERE \hrulefill \newline \hrulefill ; \end{alltt}

9 15 marks long_answer p. 14 8.2

A program is required to enable voting in class surveys, for example to find the most popular smartphone.

The one-dimensional (1D) array \texttt{Options[]} is used to store between 2 and 12 options on which users can vote.

The one-dimensional (1D) array \texttt{Votes[]} is used to store the votes of between 2 and 1000 users.

The one-dimensional (1D) array \texttt{VoteCount[]} is used to store the number of votes for each of the options. The array index represents the option number.

Write a program for the following requirements:

\begin{itemize} \item Initialise all the arrays before they are used. \item Input and validate the number of options and the number of voters. \item Input each of the required options and store them in the array \texttt{Options[]} \item Display the list of options for each voter and allow each voter to input their preferred option. Validate this input and store it in the array \texttt{Votes[]} \item Once all the votes have been input, count the number of voters who chose each option and find the most and least popular options. \item Output the most and least popular options as well as the number of voters who selected each of these options. \end{itemize}

The program does \textbf{not} need to identify if two or more options are the equal most or least popular.

You must use pseudocode or program code, and add comments to explain how your code works.

Do \textbf{not} declare arrays, variables or constants for this algorithm; assume this has been done. Initialisation must be carried out as appropriate.

All inputs and outputs must contain suitable messages.

Log in or create account

IGCSE & A-Level