Computer Science 9618/23 — May/June 2023
Cambridge AS Level · Fundamental Problem-solving and Programming Skills · worked solutions for every part, with the mark scheme
Topics Algorithm Design and Problem-solving · Data Types and Structures · Programming · 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.
Line numbers are for reference only.
10 DECLARE Sheet4 : ARRAY[1:2, 1:50] OF INTEGER
...
100 FOR PCount ← 0 TO 49
101 Sheet4[1, PCount] ← 0
102 Sheet4[2, PCount] ← 47
103 NEXT PCount
The pseudocode contains references to an array.
Complete the table by writing the answer for each row.
| Answer | |
|---|---|
| The dimension of the array | |
| The name of the variable used as an array index | |
| The number of elements in the array |
The pseudocode contains two errors. One error is that variable PCount has not been declared.
Identify the other error and state the line number where it occurs.
Error ..........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Line number ..............................................................................................................................
The pseudocode does not include a declaration for PCount.
State the data type that should be used in the declaration.
.............................................................................................................................................
The pseudocode statements given in the following table are used in other parts of the algorithm.
Complete the table by placing one or more ticks (✓) in each row.
The first row has already been completed.
| Pseudocode statement | Input | Process | Output |
|---|---|---|---|
INPUT MyChoice | ✓ | ||
OUTPUT FirstName & LastName | |||
WRITEFILE YourFile, TextLine | |||
READFILE MyFile, TextLine | |||
Result ← SQRT(NextNum) |
The rest of this paper
7 more questions- Q2Programming · Algorithm Design and Problem-solving6M
- Q3Data Types and Structures · Algorithm Design and Problem-solving11M
- Q4Programming6M
- Q5Software Development4M
- Q6Programming · Data Types and Structures · Algorithm Design and Problem-solving11M
- Q7Algorithm Design and Problem-solving · Data Types and Structures · Software Development · Programming8M
- Q8Data Types and Structures · Programming · Algorithm Design and Problem-solving19M