A logistics warehouse uses a grid coordinate system to label its cargo storage bays. The coordinate layout is a 4x4 grid as shown in Figure 1.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | ||||
| 2 | [Cargo] | |||
| 3 | ||||
| 4 |
valid = False
while valid == False:
code = ""
while len(code) != 2:
code = input("Enter cargo bay reference (eg A2): ")
code = code.upper()
Extend the Python program in Figure 2 so that it completes the validation checks matches the coordinate layout in Figure 1.
Your extended program must:
validvalid to True if both checks are metYou should write Python code or precise pseudocode in your answer.
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.