Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance

Q40 · 9618/22/O/N/22 Q1

Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.

Q409618/22/O/N/22original Q1Structured · 11 marks
Question 1 from 9618/22/O/N/22

Worked solution

(a)(i)

Write any two of these:

Part of the algorithm is repeated or reused in several places [1]

Part of the algorithm does one specific task [1]

It makes the program simpler, or an existing subroutine can be used. Testing, debugging and maintenance also become easier.

(a)(ii)

Term: parameters [1]

Use: they pass values (arguments) into the procedure when it is called. [1]

(b)

Test stage: beta testing [1]

Description (any three of these):

It is done by a small group of potential users [1]

The users check that the software works as required in the real world and has no errors [1]

The users report problems and suggest improvements [1]

The problems and suggestions are dealt with before the program is sold. (Only three of these four points score.)

(c)

Work out each expression using the example values: the month of 23/04/2004 is 4, so MID("ABCDEF", 4, 1) is the 4th letter. 29 ÷ 6 = 4.83, so INT gives 4. Count >= 29 is TRUE but DAY is 23, so DAY > 23 is FALSE, and TRUE AND FALSE is FALSE.

ExpressionEvaluation
MID(CharList, MONTH(FlagDay), 1)"D"
INT(Count / LENGTH(CharList))4
(Count >= 29) AND (DAY(FlagDay) > 23)FALSE

Row 1 correct [1]

Row 2 correct [1]

Row 3 correct [1]

KEY IDEAEvaluate built-in functions one at a time, then combine the results with the AND or OR.
TOTAL 11 marks

Official mark scheme

Mark scheme for 9618/22/O/N/22 question 1
VIDEO
▶ Whole paper

Video solution of the whole paper · by Audere Prep. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.