9618/23

Computer Science 9618/23May/June 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 Algorithm Design and Problem-solving · Data Types and Structures · Programming · Software Development

Q1Data Types and StructuresAlgorithm Design and Problem-solvingFree sample

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
(a)

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
3M
(b)

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 ..............................................................................................................................

2M
(c)

The pseudocode does not include a declaration for PCount.

State the data type that should be used in the declaration.

.............................................................................................................................................

1M
(d)

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 statementInputProcessOutput
INPUT MyChoice
OUTPUT FirstName & LastName
WRITEFILE YourFile, TextLine
READFILE MyFile, TextLine
Result ← SQRT(NextNum)
4M

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
Loading the full paper…