Skip to content
ExamSpine

Lesson 8.2 · Answer it

Ticket plan

4 marksYou mark it yourself against the marking points

A rail company's app sells train tickets. Each ticket is for one trip, from a starting station to an end station, and has a price in cents. On the train, a guard checks the ticket. A ticket can be checked only once: if it has been checked before, the guard is told it is not valid.

A student plans a class Ticket like this:

  • Attributes: start station, end station, price, check
  • Methods: none

(a) Identify the item in the student's list of attributes that should be a method, and explain why. [2]

(b) Identify one attribute that is missing from the plan, and explain why Ticket needs it. [2]

[4]