Past-paper question · 2022 October-November · Paper 22 · Q6(b)

Question 6(b) 2022 · October-November · Paper 22 · 4 marks

Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Original past-paper question for 6(B)
Reveal official mark-scheme answer Official mark-scheme answer for 6(B)

Official answer for Question 6

Part (b)

✓
One mark per row.

Question 4

✓
Examples of invalid strings:

Question 1

✓
Non-numeric but not "End" // contains space or other non-numeric
✓
characters

Question 2

✓
Real number

Question 3

✓
Integer value out of range (i.e. <= 0)

Question 4

✓
Empty string

Question 5

✓
Correct word but wrong case e.g. "end" rather than "End"
✓
Input
✓
Reason for choice
✓
"Aardvark"
✓
Non-numeric (and not "End")
✓
"27.3"
✓
Numeric but not an integer
✓
"-3" // "0"
✓
A non-positive integer
✓
""
✓
An empty string
✓
Cambridge International AS & A Level – Mark Scheme
✓
9618/22
✓
October/November
✓
PUBLISHED
✓
2022
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_w22_ms_22.pdf →

Show text version of question

Question 6

Part (b)

Part (b)

A program is written to allow a user to input a sequence of values to be checked using the

function FindBaseNumber().

The user will input one value at a time. The variable used to store the user input has to be of type string because the user will input ‘End’ to end the program.

Valid input will be converted to an integer and passed to FindBaseNumber() and the return value will be output.

Complete the table by giving four invalid strings that may be used to test distinct aspects of the required validation. Give the reason for your choice in each case.

Input Reason for choice

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

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

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

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

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

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

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

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

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

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

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

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

[4]

Question 15

Question 16

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 9618_w22_qp_22.pdf

Keep practising this topic