Robust and secure programming

EasyMediumHard
123456789101112131415161718
Question 7
Easy

A Python program is written to validate that a user's input age is between 11 and 18 (inclusive) before registering them for a youth sports club.

Figure 1 shows the Python code.

print("Enter your age (11-18):")
age = int(input())
while age < 11 or age > 18:
    print("Age rejected")
    age = int(input())
print("Age accepted")

Table 1 shows an incomplete test plan to test this validation logic.

Test numberTest typeTest dataExpected result
1Erroneous8(a)
2Boundary(b)Age accepted
3Normal14Age accepted

Complete the test plan by stating the missing values for (a) and (b).

a.

(a)

[1]
b.

(b)

[1]

Robust and secure programming Questions

  1. GCSE
  2. /Computer Science
  3. /Robust and secure programming