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().
26 exam-style questions on OCR GCSE Computer Science Data types. Each one has a worked solution and a mark scheme showing where the marks go.