Past-paper question · 2017 May-June · Paper 21 · Q6(b)(i)

Question 6(b)(i) 2017 · May-June · Paper 21 · 5 marks

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

Official answer for Question 6

Part (b)

(i)

✓
String1: (e.g. “AAbb123”)

Question 5

✓
One mark for a valid string having:
  • at least 2 uppercase alphabetic
  • at least 2 lowercase alphabetic
  • at least 3 numeric characters
  • No other character
✓
String2 – String5:
✓
One mark for correct string and explanation (testing different rules of the
✓
function)
✓
Test strings breaking different rules:
  • With incorrect numbers of:
  • Lower case characters
  • Upper case characters
  • Numeric characters
  • Containing an invalid character

Mark scheme 9608_s17_ms_21.pdf →

Show text version of question

Question 6

Part (b)

(i)

Question 6

A multi-user computer system makes use of passwords.

To be valid, a password must comply with the following rules:

  • at least two lower-case alphabetic characters
  • at least two upper-case alphabetic characters
  • at least three numeric characters
  • alpha-numeric characters only
A
function, ValidatePassword, is needed to check that a given password follows these rules.

This function takes a string, Pass, as a parameter and returns a Boolean value:

  • TRUE if Pass contains a valid password
  • FALSE otherwise.

(i)

The function will be tested.

Give a valid string to check that the function returns TRUE under the correct conditions.

String1: ..............................................................................................................................

Modify the valid string given for String1 to test each rule separately.

Explain your choice in each case.

String2: ..............................................................................................................................

Explanation: ......................................................................................................................

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

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

String3: ..............................................................................................................................

Explanation: ......................................................................................................................

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

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

String4: ..............................................................................................................................

Explanation: ......................................................................................................................

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

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

String5: ..............................................................................................................................

Explanation: ......................................................................................................................

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

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

[5]
Topic relevance

Why this question appears here

71% 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 9608_s17_qp_21.pdf

Keep practising this topic