Project: A Day-Trip Ticket Checker

Over this course, the day-trip ticket desk has picked up one skill at a time. Your ticket.js chain gave every visitor exactly one ticket, && turned the member rule into a single branch, member.js cleaned a typed “yes”, and age.js checked an age answer before converting it.

Now you’ll put those pieces together into a ticket checker that turns a visitor’s two typed answers into a price.

You’ll build it on-site in the next two exercises, with automatic feedback at each step. This brief gives you the desk’s rules, shows how the tests call your checker, and sets out a short plan.

Read the Published Rule Table

The desk’s prices are in whole cents, the way its till counts money, so a $16.00 ticket is 1600:

Visitor Price in cents
Under 5 0 (free entry)
5 to under 16 800
16 to under 65, trip club member 1200
16 to under 65, not a member 1600
65 and over 1000

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.