A laboratory inventory system tracks hazardous chemical containers. Each container material has a specific code, as shown below:
| Code | Material |
|---|---|
| GL | Glass |
| PL | Plastic |
| MT | Metal |
A program is written to log new batches into the inventory database. The program:
IsValidContainer() to check whether the entered material code is validRegisterBatch() to update the database01 containerCode = input("Enter container material code: ")
02 batchNum = input("Enter batch number: ")
03 if (IsValidContainer(containerCode)) then
04 trackingRef = containerCode + "-" + batchNum
05 RegisterBatch(trackingRef)
06 else
07 print("Error: Invalid container code.")
08 endif
Give the line number that contains the call to the prewritten validation function.
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.