A secure access control system at a biological research facility regulates entry based on clearance levels. The clearance codes are defined in the table below:
| Code | Clearance Level |
|---|---|
| L1 | General Lab Area |
| L2 | Restricted Bio-hazard |
| L3 | High-Containment Suite |
A program is written to process access requests at the security gate. The program:
ValidateClearance() to verify if the entered code is valid.GrantAccess() is called.01 clearanceLevel = input("Enter clearance code:")
02 if ValidateClearance(clearanceLevel) then
03 employeeID = input("Enter employee ID:")
04 accessToken = clearanceLevel + employeeID
05 GrantAccess(accessToken)
06 endif
Identify two programming constructs that have been used in the program above.
95 exam-style questions on OCR GCSE Computer Science Programming fundamentals. Each one has a worked solution and a mark scheme showing where the marks go.