Past-paper question · 2022 October-November · Paper 21 · Q8(d)

Question 8(d) 2022 · October-November · Paper 21 · 2 marks

Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Reveal official mark-scheme answer Official mark-scheme answer for 8(D)

Official answer for Question 8

Part (d)

✓
One mark for each (Max 2):

Question 2

✓
Examples:
✓
1 Incorrect block structure. Missing keyword denoting part of block (for
✓
example ENDPROCEDURE, ENDFUNCTION, ENDTYPE)
✓
2 Data type errors, for example, assigning an integer value to a string
✓
3 Identifier used before it is declared
✓
4 Incorrect parameter use

Mark scheme 9618_w22_ms_21.pdf →

Show text version of question

Question 8

Part (d)

Question 8

A teacher is designing a program to perform simple syntax checks on programs written by

students. Student programs are submitted as text files, which are known as project files.

A
project file may contain blank lines.

The teacher has defined the first program module as follows:

Module Description

  • takes the name of an existing project file as a parameter of type
  • string CheckFile()

  • returns TRUE if the file is valid (it contains at least 10 non-blank

lines), otherwise returns FALSE

Part (d)

Module CheckLine() includes a check for syntax errors.

Two examples of syntax error that cannot be detected from examining a single line are those involving selection and iteration.

Give two other examples.

1 ................................................................................................................................................

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

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

2 ................................................................................................................................................

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

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

[2]

Question 18

Question 19

Question 20

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

Topic relevance

Why this question appears here

99% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9618_w22_qp_21.pdf

Keep practising this topic