Past-paper question · 2012 October-November · Paper 21 · Q2

Question 2 2012 · October-November · Paper 21 · 6 marks

Original past-paper question for 2
Reveal official mark-scheme answer Official mark-scheme answer for 2Official mark-scheme answer for 2

Official answer for Question 2

Part (a)

✓
Row
✓
Position
✓
Row<=30
✓
Position
✓
BikePlace
✓
<=3
✓
[1,1]
✓
[1,2]
✓
[1,3]
✓
[2,1]
✓
[2,2]

Mark scheme 9691_w12_ms_21.pdf →

Show text version of question

Question 2

[2]

Part (d)

Each subtask is coded as a program module.

Explain how it is possible to use the same variable name for different variables in different modules.

[2]

Part (e)

When validating the type of bike (road, hybrid, track) Soni uses

INPUT Bike

IF (Bike = “road”) (Bike = “hybrid”) (Bike = “track”)

THEN

OUTPUT Bike “ is valid”

ELSE

OUTPUT “Invalid”

ENDIF

Insert the correct Boolean operator in each space.

[2]

Question 4

Part (f)

All bikes in stock have a bike ID. Each bike ID is six characters long and has the format For

BIKEXX, where X is a digit. Examiner's Use For example, BIKE65 is a valid bike ID.

(i)

In a high-level programming language write code that will validate the format of a

bike ID input into the variable BikeID and output a suitable message. (Add extra line numbers if required.)

Programming language used

Code

Question 1

Question 2

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Programming basics

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 9691_w12_qp_21.pdf

Keep practising this topic