Skip to content

Course home

Defensive design

Defensive design

EasyMedium
12345678910
Question 5

When a new member is registered for a youth sports club, the details are entered into a program to validate the values. The following criteria must be checked:

  • memberID must not be empty
  • tier must be either "standard" or "elite"
  • age must be between 12 and 18 (inclusive)

If any invalid data is found, "REJECTED" is displayed. If all data is valid, "ACCEPTED" is displayed.

Complete the program to validate the inputs.

You must use either:

  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied (such as Python).
memberID = input("Enter member ID: ")
tier = input("Enter standard or elite: ")
age = input("Enter age: ")
registrationComplete = False
[6]
Markscheme

Defensive design Questions

  1. GCSE
  2. /Computer Science
  3. /Defensive design

14 exam-style questions on OCR GCSE Computer Science Defensive design. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank