Cambridge O Level: Computer Science 2210/21

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Cambridge O Level

COMPUTER SCIENCE 2210/21


Paper 2 Algorithms, Programming and Logic May/June 2023
MARK SCHEME
Maximum Mark: 50

Published

This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the
examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the
details of the discussions that took place at an Examiners’ meeting before marking began, which would have
considered the acceptability of alternative answers.

Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for
Teachers.

Cambridge International will not enter into discussions about these mark schemes.

Cambridge International is publishing the mark schemes for the May/June 2023 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.

This document consists of 18 printed pages.

© UCLES 2023 [Turn over


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Generic Marking Principles

These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the
specific content of the mark scheme or generic level descriptors for a question. Each question paper and mark scheme will also comply with these
marking principles.

GENERIC MARKING PRINCIPLE 1:

Marks must be awarded in line with:

 the specific content of the mark scheme or the generic level descriptors for the question
 the specific skills defined in the mark scheme or in the generic level descriptors for the question
 the standard of response required by a candidate as exemplified by the standardisation scripts.

GENERIC MARKING PRINCIPLE 2:

Marks awarded are always whole marks (not half marks, or other fractions).

GENERIC MARKING PRINCIPLE 3:

Marks must be awarded positively:

 marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit is given for valid answers which go beyond
the scope of the syllabus and mark scheme, referring to your Team Leader as appropriate
 marks are awarded when candidates clearly demonstrate what they know and can do
 marks are not deducted for errors
 marks are not deducted for omissions
 answers should only be judged on the quality of spelling, punctuation and grammar when these features are specifically assessed by the
question as indicated by the mark scheme. The meaning, however, should be unambiguous.

GENERIC MARKING PRINCIPLE 4:

Rules must be applied consistently, e.g. in situations where candidates have not followed instructions or in the application of generic level
descriptors.

© UCLES 2023 Page 2 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
GENERIC MARKING PRINCIPLE 5:

Marks should be awarded using the full range of marks defined in the mark scheme for the question (however; the use of the full mark range may
be limited according to the quality of the candidate responses seen).

GENERIC MARKING PRINCIPLE 6:

Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or
grade descriptors in mind.

© UCLES 2023 Page 3 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

1(a) One mark for each correct line. 4

Program development life cycle description Program development life cycle stage

develop an algorithm to solve the analysis


problem using structure diagrams,
flowcharts or pseudocode

coding
detect and fix the errors in the
program
design

identify the problem and its


requirements
evaluation

write and implement the


instructions to solve the problem testing

1(b) One mark for naming or describing each component part, max three 3

For example:

inputs // what is put into the system


processes // actions taken to achieve a result
outputs // what is taken out of the system
storage // what needs to be kept for future use

© UCLES 2023 Page 4 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

2 A 1

Question Answer Marks

3(a) One mark per mark point, max two 2

 Validation is an automated check carried out by a computer


 … to make sure the data entered is sensible/acceptable/reasonable

3(b) One mark for each appropriate test data, max three 6
One mark for each correct accompanying reason, max three

For example:

Normal – 75
Reason – the data lies within the required range and should be accepted

Abnormal – Sixty
Reason – this is the wrong data type and should be rejected

Extreme – 200
Reason – the highest value in the required range that should be accepted

© UCLES 2023 Page 5 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

4 One mark per mark point, max four 4

DIV, max two


 To perform integer division
 Meaning only the whole number part of the answer is retained
 Example of DIV For example DIV(9,4) = 2

ROUND, max two


 To return a value rounded to a specified number of digits / decimal places
 The result will either be rounded to the next highest or the next lowest value
 … depending on whether the value of the preceding digit is >=5 or <5
 Example of ROUND for example, ROUND(4.56, 1) = 4.6

© UCLES 2023 Page 6 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

5(a) One mark per mark point, max four 4

 Line 04 / IF Number < 0


should be IF Number > 0

 Line 10 / Exit  1 // Line 01/ Exit  1 and Line 02 / WHILE Exit <> 0
should be Exit  0 // should be Exit  0 and WHILE Exit = 0

 Line 13 / ENDIF
should be ENDWHILE

 Line 14 / OUTPUT "The total value of your numbers is ", Number


should be OUTPUT "The total value of your numbers is ", Total

Correct algorithm:

01 Exit  1
02 WHILE Exit <> 0 DO
03 INPUT Number
04 IF Number > 0
05 THEN
06 Total  Total + Number
07 ELSE
08 IF Number = 0
09 THEN
10 Exit  0
11 ENDIF
12 ENDIF
13 ENDWHILE
14 OUTPUT "The total value of your numbers is ", Total

© UCLES 2023 Page 7 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

5(b) One mark per mark point, max four 4


 Initialise a new (counting) variable
 … Count  0 // to count the acceptable numbers
 Insert a counting statement between lines 05 and 07
 … Count  Count + 1
 Add a new output after the loop/after line 13 / at the end (of the program)
 … OUTPUT Count

Question Answer Marks

6 One mark for each correct feature, max two 4


One mark for each correct accompanying reason, max two

For example:

Meaningful identifiers – to enable the programmer (or future programmers) to easily recognize the purpose of a variable /
array / constant // to enable easy tracking of a variable / constant / array through the program

Use of comments – to annotate each section of a program so that a programmer can find specific sections / so that the
programmer knows the purpose of that section of code

Procedures and functions – to make programs modular and easier to update / add functionality

© UCLES 2023 Page 8 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

7(a) One mark per correct column, max four 4

Pointer Letter Choice OUTPUT

1 F

6 Letter F is represented by Foxtrot

Another Letter? (Y or N)

1 D

4 Letter D is represented by Delta

Another Letter? (Y or N)

7(b) (Linear) search 1

© UCLES 2023 Page 9 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

7(c) One mark per mark point, max two 2

 The algorithm would not stop


 … because it would not have found the item it was seeking

Or

 The array would run out of values after the pointer reached 13
 the algorithm will crash

Question Answer Marks

8(a) One mark per mark point, max three 3


 Storing string in Phrase
 Correct use of LENGTH function
 Correct use of UCASE function
 Correct outputs of LENGTH and UCASE

For example:

Phrase  "The beginning is the most important part"


OUTPUT LENGTH(Phrase)
OUTPUT UCASE(Phrase)

8(b) One mark for each correct line, max two 2

40
THE BEGINNING IS THE MOST IMPORTANT PART

© UCLES 2023 Page 10 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

9(a) One mark for each correct gate, with the correct input(s) as shown. 4

© UCLES 2023 Page 11 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

9(b) Four marks for eight correct outputs. 4


Three marks for six or seven correct outputs.
Two marks for four or five correct outputs.
One mark for two or three correct outputs

A B C Z

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 0

Question Answer Marks

10(a) One mark for the correct field name 2


One mark for the correct reason

For example:

TVCode
Each entry in this field is a unique identifier

© UCLES 2023 Page 12 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

10(b) Two marks for four correct answers. 2


One mark for two or three correct answers.

Field Data type

TVCode Text

ScreenSize Integer

SmartTV Boolean

Price$ Real

10(c) One mark for each correct answer 4

ScreenSize
Price$
FROM
YES

Correct code:

SELECT TVCode, ScreenSize, Price$


FROM TVRange
WHERE SmartTV = YES;

© UCLES 2023 Page 13 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

11 Read the whole answer: 15


Check if each requirement listed below has been met. Requirements may be met using a suitable built-in function from the
programming language used (Python, VB.NET or Java).
On place a SEEN mark if requirement met, cross if no attempt seen, omission mark and/or comment if partially met (see
marked scripts).

Use the tables for AO2 and AO3 below to award a mark in a suitable band using a best fit approach, then add up the total:
 AO2 (maximum 9 marks)
 AO3 (maximum 6 marks)

Data structures required:


The names underlined must match those given in the scenario:

Arrays or lists Days[], Readings[], AverageTemp[]

Variables WeekLoop, DayLoop, InTemp, TotalDayTemp, TotalWeekTemp, AverageWeekTemp

Requirements (techniques):
R1 Input and store hourly temperatures and validation of input temperatures for each day (with prompts, range check and
(nested)iteration)
R2 Calculate, round to one decimal place and store daily average temperatures and calculate the weekly average
temperature rounded to one decimal place (iteration, totalling and rounding)
R3 Convert all average temperatures to Fahrenheit (to one decimal place) and output the average temperatures in both
Celsius and Fahrenheit. Output with appropriate messages. (output and rounding)

© UCLES 2023 Page 14 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

11 Example 15 mark answer in pseudocode

// meaningful identifiers and appropriate data structures for


// all data required
DECLARE Days : ARRAY[1:7] OF STRING
DECLARE Readings : ARRAY[1:7, 1:24] OF REAL
DECLARE AverageTemp : ARRAY[1:7] OF REAL
DECLARE WeekLoop : INTEGER
DECLARE DayLoop : INTEGER
DECLARE InTemp : REAL
DECLARE TotalDayTemp : REAL
DECLARE TotalWeekTemp : REAL
DECLARE AverageWeekTemp : REAL
// initial population of Days[] array
// input and a loop are also acceptable
Days[1]  "Sunday"
Days[2]  "Monday"
Days[3]  "Tuesday"
Days[4]  "Wednesday"
Days[5]  "Thursday"
Days[6]  "Friday"
Days[7]  "Saturday"
// input temperatures inside nested loop
FOR WeekLoop  1 TO 7
TotalDayTemp  0
FOR DayLoop  1 TO 24
OUTPUT "Enter temperature ", DayLoop, " for ", Days[WeekLoop]

© UCLES 2023 Page 15 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Question Answer Marks

11 INPUT InTemp
// validation of input for between -20 and +50 inclusive
WHILE InTemp < -20.0 OR InTemp > 50.0 DO
OUTPUT "Your temperature must be between -20.0 and +50.0 inclusive. Please try
again"
INPUT InTemp
ENDWHILE
Readings[WeekLoop, DayLoop]  InTemp
// totalling of temperatures during the day
TotalDayTemp  TotalDayTemp + ROUND(InTemp, 1)
NEXT DayLoop

// average temperature for the day


AverageTemp[WeekLoop]  ROUND(TotalDayTemp / 24,1)
NEXT WeekLoop
// calculate the average temperature for the week
TotalWeekTemp  0
FOR WeekLoop  1 TO 7
TotalWeekTemp  TotalWeekTemp + AverageTemp[WeekLoop]
NEXT WeekLoop

AverageWeekTemp  ROUND(TotalWeekTemp / 7,1)


// outputs in Celsius and Fahrenheit
FOR WeekLoop  1 TO 7
OUTPUT "The average temperature on ", Days[WeekLoop], " was ", AverageTemp[WeekLoop], "
Celsius and ",
ROUND(AverageWeekTemp * 9 / 5 + 32), 1, " Fahrenheit"
NEXT WeekLoop

OUTPUT "The average temperature for the week was ",


AverageWeekTemp," Celsius and ", ROUND(AverageWeekTemp * 9 / 5 + 32, 1),"
Fahrenheit"

© UCLES 2023 Page 16 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Marking Instructions in italics

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

0 1–3 4–6 7–9

At least one programming technique has Some programming techniques used are The range of programming techniques
been used. appropriate to the problem. used is appropriate to the problem.

Any use of selection, iteration, counting, More than one technique seen applied All criteria stated for the scenario have
totalling, input and output. to the scenario, check the list of been covered by the use of appropriate
techniques needed. programming techniques, check the list
No creditable of techniques needed.
response.
Some data has been stored but not Some of the data structures chosen are The data structures chosen are
appropriately. appropriate and store some of the data appropriate and store all the data
required. required.
Any use of variables or arrays or other
language dependent data structures e.g. More than one data structure used to The data structures used store all the
Python lists. store data required by the scenario. data required by the scenario.

© UCLES 2023 Page 17 of 18


2210/21 Cambridge O Level – Mark Scheme May/June 2023
PUBLISHED
Marking Instructions in italics

AO3: Provide solutions to problems by:


 evaluating computer systems
 making reasoned judgements
 presenting conclusions

0 1–2 3–4 5–6

Program seen without relevant Program seen with some relevant The program has been fully commented.
comments. comment(s).

Some identifier names used are The majority of identifiers used are Suitable identifiers with names
appropriate. appropriately named. meaningful to their purpose have been
used throughout.
Some of the data structures used have Most of the data structures used have
meaningful names. meaningful names. All of the data structures used have
meaningful names.

The solution is illogical. The solution contains parts that may be The program is in a logical order.
illogical.
No creditable The solution is inaccurate in many The solution contains parts that are The solution is accurate.
response. places. inaccurate.
Solution logically performs all the tasks
Solution contains few lines of code with Solution contains lines of code with given in the scenario. Ignore minor
errors that attempt to perform a task some errors that logically perform tasks syntax errors.
given in the scenario. given in the scenario. Ignore minor
syntax errors.

The solution attempts at least one of the The solution meets most of the The solution meets all the requirements
requirements. requirements. given in the question.

Solution contains lines of code that Solution contains lines of code that Solution performs all the tasks given in
attempt at least one task given in the perform most tasks given in the the scenario.
scenario. scenario.

© UCLES 2023 Page 18 of 18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy