Skip to content

Course home

Data types

Data types

Easy
1234567891011121314151617181920212223242526
Question 23

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]
Markscheme

Data types Questions

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

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.

Question bank