An ticketing system uses codes to identify different passenger ticket types. The code for each passenger type is shown in the table:
| Code | Passenger Type |
|---|---|
| AD | Adult |
| CH | Child |
| SE | Senior |
A program is written to process purchases. The program:
CheckTicketCode() to check whether the code entered is a valid code01 ticketType = input("Enter the ticket type code to purchase")
02 if CheckTicketCode(ticketType) then
03 ticketCount = input("Enter the number of tickets to purchase")
04 print("Processing " + ticketCount + " " + ticketType + " tickets.")
05 endif
Identify the data type of the value returned by the function CheckTicketCode().
Practise OCR GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 26 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.