Computer Science 9618/21 — October/November 2023
Cambridge AS Level · Fundamental Problem-solving and Programming Skills · worked solutions for every part, with the mark scheme
Topics Programming · Data Types and Structures · Algorithm Design and Problem-solving · Software Development
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
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 |
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.
The following line is added immediately before the ENDCASE statement:
OTHERWISE : Level ← "Undefined"
State why this assignment is never performed.
Give the appropriate data types for the variables ThisValue, Check and Level.
ThisValue ..............................................................................................................................
Check .......................................................................................................................................
Level ......................................................................................................................................
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