Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if not age.isdigit(): | ANo input control: a non-number or a negative quantity is passed straight to the order, which can crash the system | |
| 2if role != "admin": | BNo access limit: the program welcomes the user without checking the password, so anyone gets in | |
| 3Feedback control: the system tells the user what happened so they can correct their action | CAn input control: it checks the data type and rejects non-numeric input before the system uses it | |
| 4Input control: reject values outside the allowed range | Dprint("Error: enter a number from 1 to 10") | |
| 5password = input() print("Welcome") | EAn access limit: it stops users who are not administrators from reaching restricted actions | |
| 6qty = int(input()) order(qty) | Fif mark < 0 or mark > 100: |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
system control — A mechanism, such as input validation, user feedback or access limits, that keeps a system's behaviour within what is intended.if age >= 0 and age <= 120:
print("Valid age")value = input("Enter a number: ")
while not value.isdigit():
value = input("Try again: ")if score < 0:
print("Score cannot be negative")if role != "admin":
print("Access denied")attempts = 0
while attempts < 3:
attempts += 1