O Level Computer Science 2210 Paper 21, May/June 2025

Question paper and mark scheme75 marks10 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

2210/21 · May/June 2025

Download PDF
2

Four requirements for validating inputs and five types of validation check are given.

a

Draw one line from each requirement to the most appropriate validation check. Not all validation checks will be used. Requirement Date of birth must be between 01/01/1900 and 01/01/2010. Name has been entered. Password has exactly 12 characters. Student ID must contain 2 letters followed by a 4-digit number. Validation check length check format check range check check digit presence check

[4]
b

Identify and describe one verification check that could be applied when a new password is input into a system. Verification check ...................................................................................................................... Description ................................................................................................................................ ................................................................................................................................................... ................................................................................................................................................... ...................................................................................................................................................

[3]
3

The following pseudocode algorithm uses a count-controlled loop to read in 10 names and store them in the array Names[] FOR Count ← 1 TO 10 OUTPUT "Please enter a name" INPUT Name Names[Count] ← Name NEXT Count Rewrite the algorithm in pseudocode, using a condition-controlled loop instead of a count-controlled loop.

[4]
4

A telephone number with 13 characters is input. The first character is a ‘+’, followed by a 2-digit country code, for example: +20xxxxxxxxxx where 20 is the country code and x is a digit between 0 and 9 inclusive. The algorithm includes checks for the country codes: 44 for the UK and 20 for Egypt.

a

Write an algorithm using pseudocode to: • input the telephone number • extract the 2-digit country code • output the matching country • output ‘Unknown’ if there is no matching country.

[5]
b

Explain how you could change the algorithm to repeatedly prompt for the telephone number until the number entered is 13 characters in length. Any code used must be fully explained.

[3]
5

Two library routines used in programming are MOD and DIV. State the purpose of each of the library routines. Give one example pseudocode statement for each of the library routines. MOD purpose ................................................................................................................................... .......................................................................................................................................................... Example pseudocode ...................................................................................................................... .......................................................................................................................................................... DIV purpose ..................................................................................................................................... .......................................................................................................................................................... Example pseudocode ...................................................................................................................... ..........................................................................................................................................................

[4]
6

An algorithm has been written in pseudocode to generate a random integer between 1 and 100 inclusive and store the value in N. The user enters a guess for the number and the algorithm indicates whether the guess is higher or lower than the random number. The algorithm outputs the number of guesses when the user has correctly guessed the random number. 01 Counter ← 0 02 N ← ROUND(RANDOM() * 99, 1) + 1 03 REPEAT 04 OUTPUT "Please enter a guess" 05 INPUT G 06 IF G > N 07 THEN 08 OUTPUT "The number is lower than your guess" 09 ELSE 10 IF G < N 11 THEN 12 OUTPUT "The number is lower than your guess" 13 ENDIF 14 Counter ← Counter + 1 15 ENDIF 16 UNTIL G = N 17 OUTPUT "Well done, you took ", Guess, " attempts"

a

Identify the line numbers of the 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]
b

Identify one method to make the algorithm maintainable. Give an example.

[2]
7

Consider the logic expression: X=(A AND B) XOR (B OR NOT C)

a

Draw a logic circuit for this 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]
8

A bus company has set up a new database table called BUS to store details of the buses leaving the main bus terminal. RouteID | Destination | Stops | Driver | Time | Return BC01 | Town Centre | 10 | B Smith | 9:00 | Yes BC02 | The Fountain | 5 | A Patel | 9:10 | Yes BC03 | The Palace | 9 | B Hayes | 9:28 | No BC04 | City Park | 12 | W Gao | 9:55 | Yes BC05 | City Mall | 9 | R Hussein | 10:10 | No BC06 | Swan Lake | 14 | S Clarke | 10:33 | No BC07 | Guildhall Square | 7 | J Page | 11:34 | No BC08 | Sunset Quay | 6 | A Patel | 12:01 | Yes BC10 | Fort Worthington | 15 | E Carr | 12:01 | Yes BC12 | The Observatory | 18 | B Smith | 13:27 | No BC14 | East Seaport | 11 | B Scott | 14:07 | No BC15 | The Football Ground | 12 | J Page | 14:46 | Yes BC19 | The Cricket Ground | 11 | B Hayes | 15:14 | No BC23 | Temple Ruins | 14 | W Gao | 16:16 | No BC27 | The University | 9 | A Patel | 16:45 | No

a(i)

Identify one appropriate data type for the field Return

[1]
a(ii)

State the reason for the data type chosen.

[1]
b

Write the output from the structured query language (SQL) statement: SELECT RouteID, Destination, Time FROM BUS WHERE Driver = "A Patel";

[2]
c

Complete the SQL statement to display only the destination of the buses that have a return. SELECT ..................................................................................................................................... ................................................................................................................................................... ...................................................................................................................................................

[3]
9

The variables A and B are used in a program. A holds a whole number and B holds text.

a

Write pseudocode statements to declare the variables A and B

[2]
b

The function Odds(X) returns ‘Odd’ if the value of X is an odd number and returns ‘Even’ if the value of X is an even number. Write pseudocode statements to: • define the function • call the function using parameter A and store the return item in variable B Function definition .................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... Function call ............................................................................................................................. ...................................................................................................................................................

[6]
10

The flowchart represents an algorithm to calculate grades.

Figure 1 of 10 for question 10
Figure 2 of 10 for question 10
Figure 3 of 10 for question 10
Figure 4 of 10 for question 10
Figure 5 of 10 for question 10
Figure 6 of 10 for question 10
Figure 7 of 10 for question 10
Figure 8 of 10 for question 10
Figure 9 of 10 for question 10
Figure 10 of 10 for question 10
a

Complete the trace table for the algorithm, using the input data: 21, 46, 63, 91, 12

[3]
b

Explain how the flowchart can be changed to produce the correct output.

[4]
11

The one-dimensional (1D) array CompetitorName[] contains the names of 25 competitors in a tournament that includes five events. Another two-dimensional (2D) array CompetitorScore[] contains the points scored by each competitor in the five events. The first dimension of this array contains the index of the competitor from CompetitorName[] and the second dimension contains their scores. Each competitor receives a score out of 100 for each event. These scores are manually entered into CompetitorScore[] Medals are awarded to the competitor or the competitors who have: • the highest points scored in each of the five events • the highest total points scored for all five events. The one-dimensional (1D) array Points[] stores the total number of points scored for each competitor. Write a program that meets the following requirements: • takes as input, valid scores (between 0 and 100), for each competitor in each of the five events • calculates the highest points scored for each event • outputs the names of the competitors who receive a medal for the highest points scored • calculates the highest total points scored for the five events • outputs the names of the competitors with the highest total points scored for the five events. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables. All inputs and outputs must contain suitable messages.

[15]

Mark scheme

2210/21 · May/June 2025

Download PDF

2a · 4 marks

  • 1 mark

    Date of birth must be between 01/01/1900 and 01/01/2010. to range check

  • 1 mark

    Name has been entered. to presence check

  • 1 mark

    Password has exactly 12 characters. to length check

  • 1 mark

    Student ID must contain 2 letters followed by 4-digit number. to format check

2b · 3 marks

  • 1 mark

    Visual check // Double entry check

  • 1 mark

    look at the data that has been entered // enter data twice

  • 1 mark

    confirm it matches // only accept identical values

3 · 4 marks

  • 1 mark

    Initialising a count variable outside of loop

  • 1 mark

    Correct use of loop with condition for 10 times (WHILE (DO)...ENDWHILE, REPEAT...UNTIL) with close

  • 1 mark

    Incrementing the count variable inside the loop

  • 1 mark

    Rest of algorithm correct

4a · 5 marks

  • 1 mark

    Correct input of number

  • 1 mark

    Use of substring ( )

  • 1 mark

    …to extract the correct number

  • 1 mark

    Correct use of IF statements/Case statement with matching END IF / END CASE

  • 1 mark

    Output of matching locations

  • 1 mark

    Output of unknown

4b · 3 marks

  • 1 mark

    Find length of input.

  • 1 mark

    Use a suitable loop (repeat/while).

  • 1 mark

    Using the correct condition

  • 1 mark

    Prompt for a 13-digit telephone number and input number inside loop.

5 · 4 marks

  • 1 mark

    MOD – returns the remainder of a division calculation.

  • 1 mark

    Example: X ← MOD(10, 3)

  • 1 mark

    DIV – Integer division/returns the quotient of a division.

  • 1 mark

    Example: Y ← DIV(10, 3)

6a · 4 marks

  • 1 mark

    Line 02 – should be N ← ROUND(RANDOM() * 99, 0) + 1

  • 1 mark

    Line 12 – should be OUTPUT "The number is higher than your guess"

  • 1 mark

    Line 14/15 - Counter ← Counter + 1 should be placed after Line 15/After ENDIF/before UNTIL G = N/before Line 16

  • 1 mark

    Line 17 – should be OUTPUT "Well done, you took ", Counter, " attempts"

6b · 2 marks

  • 1 mark

    Meaningful identifiers, N should be Number.

  • 1 mark

    Comments, // loops until the guess equals the number

  • 1 mark

    Procedures/functions, making the algorithm a procedure/function

7a · 4 marks

  • 1 mark

    AND gate with inputs A and B

  • 1 mark

    NOT gate with input C

  • 1 mark

    OR gate with input B and output of NOT gate

  • 1 mark

    XOR gate with output of AND gate and output of OR gate

7b · 4 marks

  • 4 marks

    8 correct outputs: 1, 0, 1, 1, 1, 0, 0, 0

8a(i) · 1 mark

  • 1 mark

    Boolean

8a(ii) · 1 mark

  • 1 mark

    There are only 2 responses / Only Yes and No / True and False

8b · 2 marks

  • 2 marks

    BC02 The Fountain 9:10 BC08 Sunset Quay 12:01 BC27 The University 16:45

8c · 3 marks

  • 1 mark

    SELECT Destination

  • 1 mark

    FROM BUS

  • 1 mark

    WHERE Return = Yes;

9a · 2 marks

  • 1 mark

    DECLARE A: INTEGER

  • 1 mark

    DECLARE B: STRING

9b · 6 marks

  • 1 mark

    using FUNCTION and ENDFUNCTION and RETURNS STRING

  • 1 mark

    naming the function Odds.

  • 1 mark

    defining the parameter correctly.

  • 1 mark

    determining if odd/even using MOD/DIV/ROUND using parameter.

  • 1 mark

    correctly returning ‘Odd’ and ‘Even’.

  • 1 mark

    correct function call

10a · 3 marks

  • 1 mark

    Score column correct

  • 1 mark

    Grade column correct

  • 1 mark

    OUTPUT column correct

10b · 4 marks

  • 1 mark

    Change the decision in the first decision box to IS Score >= 80 ?

  • 1 mark

    Change the decision in the last decision box to IS Score >= 40 ?

  • 1 mark

    Change process box from Grade  "C" to Grade  "A"

  • 1 mark

    Change process box from Grade  "A" to Grade  "C"

  • 1 mark

    Add output box instructing users to input score or input −1 before the input box // initialising a counter // incrementing counter.

  • 1 mark

    Add decision box for loop with exit condition.

  • 1 mark

    Correct arrows to show looping

11 · 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 27 marks
    Mark scheme ›
  2. 3
    Question 34 marks
    Mark scheme ›
  3. 4
    Question 48 marks
    Mark scheme ›
  4. 5
    Question 54 marks
    Mark scheme ›
  5. 6
    Question 66 marks
    Mark scheme ›
  6. 7
    Question 78 marks
    Mark scheme ›
  7. 8
    Question 87 marks
    Mark scheme ›
  8. 9
    Question 98 marks
    Mark scheme ›
  9. 10
    Question 107 marks
    Mark scheme ›
  10. 11
    Question 1115 marks
    Mark scheme ›

More 2210 papers

Other papers from May/June 2025

Solve it on ExamPalStart