Data types
23
0/1

An ticketing system uses codes to identify different passenger ticket types. The code for each passenger type is shown in the table:

CodePassenger Type
ADAdult
CHChild
SESenior

A program is written to process purchases. The program:

  • asks the user to enter the code for the ticket type they want to purchase
  • calls the function CheckTicketCode() to check whether the code entered is a valid code
  • asks for the number of tickets to purchase if the code is valid
01  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().

[1]

Data types Questions

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.

PreviousNext

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types