O Level Computer Science 2210 Paper 22, May/June 2023

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.

Papers open in

Opening the question paper

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

Question paper

2210/22 · May/June 2023

Download PDF
2

Four logic gates and five standard symbols for logic gates are shown. Draw one line to link each logic gate to its standard symbol. Not all standard symbols will be used. Logic gate AND OR NAND NOT Standard symbol

[4]
Figure 1 of 1 for question 2
3

Identify three different ways that the design of a solution to a problem can be presented. 1 ....................................................................................................................................................... .......................................................................................................................................................... 2 ....................................................................................................................................................... .......................................................................................................................................................... 3 ....................................................................................................................................................... ..........................................................................................................................................................

[3]
4

A program needs to make sure the value input for a measurement meets the following rules: • the value is a positive number • a value is always input • the value is less than 1000.

a

Describe the validation checks that the programmer would need to use.

[3]
b(i)

The program needs editing to include a double entry check for the value input. State why this check needs to be included.

[1]
b(ii)

The input value needs to be stored in the variable Measurement Write pseudocode to perform the double entry check until a successful input is made.

[3]
6

State three different features of a high-level programming language that a programmer could use to make sure that their program will be easier to understand by another programmer. Give an example for each feature. Feature 1 .......................................................................................................................................... .......................................................................................................................................................... Example ........................................................................................................................................... .......................................................................................................................................................... Feature 2 .......................................................................................................................................... .......................................................................................................................................................... Example ........................................................................................................................................... .......................................................................................................................................................... Feature 3 .......................................................................................................................................... .......................................................................................................................................................... Example ........................................................................................................................................... ..........................................................................................................................................................

[6]
7

An algorithm has been written in pseudocode to calculate a check digit for a four-digit number. The algorithm then outputs the five-digit number including the check digit. The algorithm stops when –1 is input as the fourth digit. 01 Flag ← FALSE 02 REPEAT 03 Total ← 0 04 FOR Counter ← 1 TO 4 05 OUTPUT "Enter a digit ", Counter 06 INPUT Number[Counter] 07 Total ← Total + Number * Counter 08 IF Number[Counter] = 0 09 THEN 10 Flag ← TRUE 11 ENDIF 12 NEXT Counter 13 IF NOT Flag 14 THEN 15 Number[5] ← MOD(Total, 10) 16 FOR Counter ← 0 TO 5 17 OUTPUT Number[Counter] 18 NEXT 19 ENDIF 20 UNTIL Flag

a

Give the line number(s) for the statements showing: Totalling .................................................................................................................................... Count-controlled loop ............................................................................................................... Post-condition loop ...................................................................................................................

[3]
b

Identify the three errors in the pseudocode and suggest a correction for each error. Error 1 ....................................................................................................................................... Correction ................................................................................................................................. ................................................................................................................................................... Error 2 ....................................................................................................................................... Correction ................................................................................................................................. ................................................................................................................................................... Error 3 ....................................................................................................................................... Correction ................................................................................................................................. ...................................................................................................................................................

[3]
c

The algorithm does not check that each input is a single digit. Identify the place in the algorithm where this check should occur. Write pseudocode for this check. Your pseudocode must make sure that the input is a single digit and checks for –1 Place in algorithm ..................................................................................................................... Pseudocode .............................................................................................................................. ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ...................................................................................................................................................

[4]
8

Consider this logic expression. X = (A OR B) AND (NOT B AND C) Complete the truth table for this logic expression.

ABCWorking spaceX
000
001
010
011
100
101
110
111
[4]
Figure 1 of 1 for question 8
9

This flowchart represents an algorithm.

Figure 1 of 1 for question 9
a

The array X[1:5] used in the flowchart contains this data:

X[1]X[2]X[3]X[4]X[5]
1015711

Complete the trace table by using the data given in the array.

FCX[1]X[2]X[3]X[4]X[5]T
1015711
[5]
b

Describe what the algorithm represented by the flowchart is doing.

[2]
10

A music streaming service has a new database table named Songs to store details of songs available for streaming. The table contains the fields: • SongNumber – the catalogue number, for example AG123 • Title – the title of the song • Author – the name of the song writer(s) • Singer – the name of the singer(s) • Genre – the type of music, for example rock • Minutes – the length of the song in minutes, for example 3.75 • Recorded – the date the song was recorded.

a

Identify the field that will be the most appropriate primary key for this table.

[1]
b

Complete the table to identify the most appropriate data type for the fields in Songs

FieldData type
SongNumber
Title
Recorded
Minutes
[2]
c

Explain the purpose of the structured query language (SQL) statements. SUM (Minutes) FROM Songs WHERE Genre = "rock"; COUNT (Title) FROM Songs WHERE Genre = "rock";

[3]
11

The variables P and Q are used to store data in a program. P stores a string. Q stores a character.

a

Write pseudocode statements to declare the variables P and Q, store "The world" in P and store 'W' in Q

[2]
b

Write a pseudocode algorithm to: • convert P to upper case • find the position of Q in the string P (the first character in this string is in position 1) • store the position of Q in the variable Position

[4]
c

Give the value of Position after the algorithm has been executed with the data in question 11(a).

[1]
12

A two-dimensional (2D) array Account[] contains account holders’ names and passwords for a banking program. A 2D array AccDetails[] has three columns containing the following details: • column one stores the balance – the amount of money in the account, for example 250.00 • column two stores the overdraft limit – the maximum total amount an account holder can borrow from the bank after the account balance reaches 0.00, for example 100.00 • column three stores the withdrawal limit – the amount of money that can be withdrawn at one time, for example 200.00 The amount of money in a bank account can be negative (overdrawn) but not by more than the overdraft limit. For example, an account with an overdraft limit of 100.00 must have a balance that is greater than or equal to –100.00 Suitable error messages must be displayed if a withdrawal cannot take place, for example if the overdraft limit or the size of withdrawal is exceeded. The bank account ID gives the index of each account holder’s data held in the two arrays. For example, account ID 20’s details would be held in: Account[20,1] and Account[20,2] AccDetails[20,1] AccDetails[20,2] and AccDetails[20,3] The variable Size contains the number of accounts. The arrays and variable Size have already been set up and the data stored. Write a program that meets the following requirements: • checks the account ID exists and the name and password entered by the account holder match the name and password stored in Account[] before any action can take place • displays a menu showing the four actions available for the account holder to choose from: 1. display balance 2. withdraw money 3. deposit money 4. exit • allows an action to be chosen and completed. Each action is completed by a procedure with a parameter of the account ID. You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs must contain suitable messages. You only need to declare any local arrays and local variables that you use. You do not need to declare and initialise the data in the global arrays Account[] and AccDetails[] and the variable Size

[15]

Mark scheme

2210/22 · May/June 2023

Download PDF

2 · 4 marks

  • 1 mark

    AND connected to standard AND gate symbol

  • 1 mark

    OR connected to standard OR gate symbol

  • 1 mark

    NAND connected to standard NAND gate symbol

  • 1 mark

    NOT connected to standard NOT gate symbol

3 · 3 marks

  • 1 mark

    structure diagram / chart

  • 1 mark

    flowchart

  • 1 mark

    pseudocode

4a · 3 marks

  • 1 mark

    range check with acceptable values is (greater than) zero and less than 1000

  • 1 mark

    presence check to ensure the program will not continue until a value has been entered

  • 1 mark

    type/character check to ensure that a number is entered

4b(i) · 1 mark

  • 1 mark

    To verify the data / for verification / as a verification check // to make sure that no changes are made to the data on entry

4b(ii) · 3 marks

  • 1 mark

    use of iteration

  • 1 mark

    use of two inputs

  • 1 mark

    to check that the two inputs are the same / different // use of the given variable Measurement

6 · 6 marks

  • 1 mark

    ensuring that all identifiers have meaningful names …

  • 1 mark

    … example using Total to store a running total

  • 1 mark

    using comments to explain how the program works …

  • 1 mark

    … example // all values are zeroed before the next calculation

  • 1 mark

    using procedures and functions for the tasks within a program …

  • 1 mark

    … example CalculateInterest(Deposit, Rate)

7a · 3 marks

  • 1 mark

    07

  • 1 mark

    04/12 or 16/18

  • 1 mark

    02/20

7b · 3 marks

  • 1 mark

    Line 07 Total ← Total + Number * Counter should be Total ← Total + Number[Counter] * Counter

  • 1 mark

    Line 08 IF Number[Counter] = 0 should be IF Number[Counter] = -1 // should be IF Number[Counter] < 0

  • 1 mark

    Line 16 FOR Counter ← 0 TO 5 should be FOR Counter ← 1 TO 5

7c · 4 marks

  • 1 mark

    around lines 05 and 06 // line 07 // (immediately) after the input of the number

  • 1 mark

    Use of REPEAT … UNTIL // any working loop structure

  • 1 mark

    check for >0 // >=0 AND check for <10 // >9

  • 1 mark

    check for whole number // check for -1 // check for length of digit <> 1

8 · 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 · 5 marks

  • 1 mark

    Column F correct

  • 1 mark

    Column C correct

  • 1 mark

    Column T correct

  • 2 marks

    Columns X[1] to X[5] all entries correct (One mark for columns X[1] to X[5] with one error)

9b · 2 marks

  • 1 mark

    (bubble) sort data in array

  • 1 mark

    in ascending order

10a · 1 mark

  • 1 mark

    SongNumber

10b · 2 marks

  • 1 mark

    Two correct data types

  • 1 mark

    Remaining two correct data types

10c · 3 marks

  • 1 mark

    to find the total number of minutes of music

  • 1 mark

    to find the total number of songs

  • 1 mark

    available for the genre rock

11a · 2 marks

  • 1 mark

    Any two correct lines

  • 1 mark

    All four correct lines

11b · 4 marks

  • 1 mark

    converting P to upper case

  • 1 mark

    finding the length of P

  • 1 mark

    using a loop to check for position of Q

  • 1 mark

    using the string operation substring // storing the loop counter in Position if the value is found

11c · 1 mark

  • 1 mark

    5

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 47 marks
    Mark scheme ›
  4. 6
    Question 66 marks
    Mark scheme ›
  5. 7
    Question 710 marks
    Mark scheme ›
  6. 8
    Question 84 marks
    Mark scheme ›
  7. 9
    Question 97 marks
    Mark scheme ›
  8. 10
    Question 106 marks
    Mark scheme ›
  9. 11
    Question 117 marks
    Mark scheme ›
  10. 12
    Question 1215 marks
    Mark scheme ›

More 2210 papers

Other papers from May/June 2023

Solve it on ExamPalStart