9618/21

Computer Science 9618/21October/November 2023

Cambridge AS Level · Fundamental Problem-solving and Programming Skills · worked solutions for every part, with the mark scheme

8
questions
75
marks
120
minutes

Topics Programming · Data Types and Structures · Algorithm Design and Problem-solving · Software Development

Q1ProgrammingData Types and StructuresFree sample

Refer to the insert for the list of pseudocode functions and operators.

The following pseudocode represents part of the algorithm for a program:

CASE OF ThisValue
 < 30 : Level ← "Low" // less than 30
        Check ← 1
 < 20 : Level ← "Very Low" // less than 20
        Check ← ThisValue / 2
 30 TO 40 : Level ← "Medium" // between 30 and 40
            Check ← ThisValue / 3
            Data[ThisValue] ← Data[ThisValue] + 1
 > 40 : Level ← "High"
ENDCASE
(a)

Complete the table by writing the answer for each row:

Answer
The value assigned to Level when ThisValue is 40
The value assigned to Check when ThisValue is 36
The value assigned to Level when ThisValue is 18
The number of elements in array Data that may be incremented
4M
(b)

The pseudocode contains four assignments to variable Level. One of these assignments will never be performed.

Identify this assignment and explain why this is the case.

3M
(c)

The following line is added immediately before the ENDCASE statement:

OTHERWISE : Level ← "Undefined"

State why this assignment is never performed.

1M
(d)

Give the appropriate data types for the variables ThisValue, Check and Level.

ThisValue ..............................................................................................................................

Check .......................................................................................................................................

Level ......................................................................................................................................

3M

The rest of this paper

7 more questions
  • Q2Algorithm Design and Problem-solving7M
  • Q3Data Types and Structures · Programming8M
  • Q4Data Types and Structures · Programming9M
  • Q5Software Development · Programming7M
  • Q6Programming9M
  • Q7Software Development5M
  • Q8Data Types and Structures · Programming · Algorithm Design and Problem-solving19M
Loading the full paper…