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.
Practise OCR GCSE Computer Science Programming fundamentals with exam-style questions for GCSE Computer Science. 100 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.