O Level Computer Science 2210 Paper 22, Oct/Nov 2024

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 · Oct/Nov 2024

Download PDF
3

Four flowchart symbols and five purposes are shown.

Figure 1 of 1 for question 3
a

Draw one line to link each flowchart symbol to its correct purpose. Not all purposes will be used. Flowchart symbol Purpose subroutine process flow decision terminator

[4]
b

An algorithm needs to total 50 numbers between 1 and 100 inclusive. Draw a flowchart that: • uses a count-controlled loop from 1 to 50 • uses an appropriate prompt to ask for a number between 1 and 100 • totals the numbers as they are entered • outputs the total after the loop has completed with an appropriate message.

[6]
4

This pseudocode algorithm is intended to sort a pre-populated one-dimensional (1D) array named ItemList into alphabetical order using a bubble sort. 01 DECLARE ItemList : ARRAY[1:100] OF STRING 02 DECLARE Counter : STRING 03 DECLARE Limit : INTEGER 04 DECLARE Pass : INTEGER 05 DECLARE Swapped : BOOLEAN 06 DECLARE Temp : STRING 07 Limit ← 100 08 Pass ← 1 09 Temp ← TRUE 10 WHILE Swapped = TRUE OR Pass <= Limit - 1 DO 11 Swapped ← FALSE 12 FOR Counter ← 1 TO Limit – Pass 13 IF ItemList[Counter] > ItemList[Counter + 1] 14 THEN 15 Temp ← ItemList[Counter] 16 ItemList[Counter] ← ItemList[Counter + 1] 17 ItemList[Counter] ← Temp 18 Swapped ← TRUE 19 ENDCASE 20 Pass ← Pass + 1 21 NEXT Counter 22 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

A bubble sort algorithm can be written to include features that make it more efficient. Explain why the corrected bubble sort algorithm is efficient.

[3]
5

Analysis is one stage in the program development life cycle.

a

State one other stage in the program development life cycle.

[1]
b

Describe the analysis stage of the program development life cycle.

[3]
6

Outline one type of verification check that could be used when inputting data.

[2]
7

This pseudocode represents an algorithm. An input of –1 will terminate the algorithm. DECLARE Count : INTEGER DECLARE Answer : INTEGER DECLARE Value : INTEGER REPEAT INPUT Value IF Value <> -1 THEN Answer ← Value FOR Count ← Value - 1 TO 1 STEP -1 Answer ← Answer * Count NEXT Count OUTPUT Answer ENDIF UNTIL Value = -1

a

Complete the trace table for the input data: 5, 6, –1, 20, 9, 4

[5]
b

State the purpose of this algorithm.

[1]
c

Describe the problem that would be caused in this algorithm if a Value of 1, 0 or less than –1 was input.

[2]
8

Different types of test data are used during program development to make sure a program works as intended. A program being developed takes as input whole numbers that are not greater than 80. Identify two items of test data to test the whole number limit of 80. Explain the reason for your choice of the data in each case. Test data 1 ........................................................................................................................................ Reason for choice ............................................................................................................................ .......................................................................................................................................................... Test data 2 ........................................................................................................................................ Reason for choice ............................................................................................................................ ..........................................................................................................................................................

[4]
9

Consider the logic expression: X = (NOT P OR Q) NAND (Q XOR R)

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]
10

The function LENGTH(X) calculates the length of a string X Write the pseudocode statements to: • allow a line of text to be input to an appropriate variable • store this line of text in a text file called Main.txt • calculate the length of the line of text and output the text in lower case along with its length • store the lower-case line of text in a text file called Lowercase.txt Make sure that any variables used are declared and that both text files are closed after they have been used.

[6]
11

A database table called Booking28 stores details of hotel rooms and bookings for the week beginning Monday 7 July 2025.

a

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

[2]
b

State the reason why the Type field would not be suitable as a primary key.

[1]
c

The database uses only the data types: • alphanumeric • character • Boolean • integer • real • date/time. Complete the table to show the fields that could have the given data types. Only one field name is required in each box and each field name must be different.

[2]
d

Give the output that would be produced by the structured query language (SQL) statement: SELECT RoomNo, Type, Guests, Rate$ FROM Booking28 WHERE Mon <> T;

[3]
12

A one-dimensional (1D) array Rooms[] contains the names of up to 20 rooms in a house. A two-dimensional (2D) array Dimensions[] is used to store the length, width and area of each room. The position of any room’s data is the same in both arrays. For example, the data in index 5 of Dimensions[] belongs to the room in index 5 of Rooms[] The variable Number stores the number of rooms for which data is to be input. There must be at least 3 rooms but no more than 20. Write a program that meets the following requirements: • allows the number of rooms for which data is required to be input, stored and validated • allows the name of the room and the length and width of the room, in metres, to be entered and stored • allows the area of each room to be calculated as length multiplied by width and stored as square metres rounded to two decimal places • calculates the average size of all the rooms by area, in square metres, rounded to two decimal places • finds the largest room and smallest room by area • outputs the names of all rooms with their dimensions and area • outputs the names of the largest room and smallest room by area • outputs the total area of the house and the average size of all the rooms by area. 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; you may assume that this has already been done. All inputs and outputs must contain suitable messages.

[15]

Mark scheme

2210/22 · Oct/Nov 2024

Download PDF

3a · 4 marks

  • 1 mark

    Subroutine symbol connected to subroutine

  • 1 mark

    Terminator symbol connected to terminator

  • 1 mark

    Decision symbol connected to decision

  • 1 mark

    Parallelogram/Input/Output symbol connected to process / as shown

3b · 6 marks

  • 1 mark

    Two labelled terminators START and STOP

  • 1 mark

    Loop initialisation, incrementation and termination

  • 1 mark

    Input with prompt

  • 1 mark

    Total initialised and totalling of inputs

  • 1 mark

    Output with message

  • 1 mark

    Fully correct flowchart with all correct arrows, yes/no labels and symbols

4a · 5 marks

  • 1 mark

    Line 02 / DECLARE Counter : STRING should be DECLARE Counter : INTEGER

  • 1 mark

    Line 09 / Temp ← TRUE should be Swapped ← TRUE

  • 1 mark

    Line 10 / WHILE Swapped = TRUE OR Pass <= Limit - 1 DO should be WHILE Swapped = TRUE AND Pass <= Limit - 1 DO

  • 1 mark

    Line 17 / ItemList[Counter] ← Temp should be ItemList[Counter + 1] ← Temp

  • 1 mark

    Line 19 / ENDCASE should be ENDIF

4b · 3 marks

  • 1 mark

    The use of a flag (set initially to FALSE) to show if a swap has been made (during the current iteration)

  • 1 mark

    … to stop the loop if it has been sorted

  • 1 mark

    The reduction in the limit of the (inner) loop after each iteration (of the loop)

  • 1 mark

    … to reduce the number of comparisons / iterations required

5a · 1 mark

  • 1 mark

    Design / Coding / Testing

5b · 3 marks

  • 1 mark

    Abstraction

  • 1 mark

    Discard/remove irrelevant information / hiding complexities / keeping the key elements of the problem

  • 1 mark

    Decomposition of the problem / Breaking the problem into inputs, processes and outputs / Identification of the problem / Identification of the requirements of the solution to the problem / Research into the problem by data collection / Example of data collection

6 · 2 marks

  • 1 mark

    Visual check / Double entry check // Data entered twice

  • 1 mark

    … looking at the data that has been entered and either confirming it is correct or showing / correcting errors. / … data is entered twice and the two sets of data are compared (by the computer). If they don't match, an error has been input, so re-entry is requested.

7a · 5 marks

  • 1 mark

    Correct Value column

  • 1 mark

    Correct Count column

  • 1 mark

    Correct Answer column (down to first OUTPUT (120)) – Shaded grey

  • 1 mark

    Correct Answer column (remaining rows)

  • 1 mark

    Correct OUTPUT column

7b · 1 mark

  • 1 mark

    It multiplies the input number by one less than itself repeatedly, until the value is 1 / It calculates the number of permutations of all the numbers up to the input value

7c · 2 marks

  • 1 mark

    The program would accept the value and enter the FOR loop

  • 1 mark

    Count would keep reducing by 1 and would never reach 1, as it would already be less than 1 / There would be an endless loop

8 · 4 marks

  • 1 mark

    80

  • 1 mark

    The largest whole number that would be accepted / at the very limit / Boundary/Extreme data that would be accepted / at the very limit

  • 1 mark

    81

  • 1 mark

    The smallest whole number that would be rejected / is greater than the limit / Boundary/Abnormal/Erroneous data that would be rejected / is greater than the limit

9a · 4 marks

  • 1 mark

    NOT gate connected to input P

  • 1 mark

    OR gate connected to (NOT P) and Q

  • 1 mark

    XOR gate connected to Q and R

  • 1 mark

    NAND gate connected to OR gate and XOR gate outputs to give X

9b · 4 marks

  • 1 mark

    Two or three correct outputs

  • 1 mark

    Four or five correct outputs

  • 1 mark

    Six or seven correct outputs

  • 1 mark

    Eight correct outputs

10 · 6 marks

  • 1 mark

    Declaration of appropriate string variable(s)

  • 1 mark

    Input of a line of text

  • 1 mark

    Correct use of LCASE

  • 1 mark

    Correct use of LENGTH

  • 1 mark

    Opening of at least one of the required text files using given names (Main.txt, Lowercase.txt) / Storing of correct line of text to Main.txt / Storing of correct lines to Lowercase.txt

  • 1 mark

    Closing of both text files / Correct output

11a · 2 marks

  • 1 mark

    Fields – 11

  • 1 mark

    Records – 15

11b · 1 mark

  • 1 mark

    The Type field contains data that repeats / Data is not unique

11c · 2 marks

  • 1 mark

    Two or three correct fields

  • 1 mark

    Four correct fields

11d · 3 marks

  • 1 mark

    Data from 4 correct columns printed – any number of rows, any order

  • 1 mark

    Data in rows ordered as shown (row and column) at least two rows and two columns required

  • 1 mark

    All data correct with no extra content

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 based on marking grid)

  • 6 marks

    AO3: Provide solutions to problems by: evaluating computer systems, making reasoned judgements, presenting conclusions (Max 6 marks based on marking grid)

Questions

  1. 3
    Question 310 marks
    Mark scheme ›
  2. 4
    Question 48 marks
    Mark scheme ›
  3. 5
    Question 54 marks
    Mark scheme ›
  4. 6
    Question 62 marks
    Mark scheme ›
  5. 7
    Question 78 marks
    Mark scheme ›
  6. 8
    Question 84 marks
    Mark scheme ›
  7. 9
    Question 98 marks
    Mark scheme ›
  8. 10
    Question 106 marks
    Mark scheme ›
  9. 11
    Question 118 marks
    Mark scheme ›
  10. 12
    Question 1215 marks
    Mark scheme ›

More 2210 papers

Other papers from Oct/Nov 2024

Solve it on ExamPalStart