0 of 10 problems solved • 0%
Use in a course

Exercise prompt

Ticket Kiosk

A ticket kiosk prices by age and then applies any student discount.

Your task

Create ticketPrice using these rules:

  • Age 12 or younger: 5
  • Age 13 through 17: 8
  • Age 18 or older: 12
  • Subtract 2 afterward when the visitor has a student card

For the supplied values, display exactly Ticket: 6.

Hint

Choose the base fare before considering the student discount.