Explain Your Ticket Checker

Your ticket checker passes its tests. That’s a real milestone, because it means getTicketPrice() gives the right price for each tested visitor, including those at tricky boundary ages, and rejects invalid inputs. Nice work!

Passing the tests shows that your checker works. This last project step is about why it works. You’ll explain two of its results branch by branch and move one age boundary the way a ticket desk might when its prices change. Then you’ll choose a new visitor whose ticket price would distinguish a mistaken rule from the intended one. Those are the skills you’ll use whenever someone asks you to check or change code, whether you wrote it or not.

Before you start, open Price the Day-Trip Ticket in another tab so your finished getTicketPrice() is in view, and keep the rule table from the project brief handy. A pen and paper help too, just as they did when you planned your expected results.

Talk Through Your Checker With the Mentor

The button below opens a new conversation with the mentor, which runs this step as a short review of your code. It starts by asking you to paste your finished getTicketPrice() into the chat, since it can’t see the exercise editor. Then it asks one question at a time and responds to each answer before moving on:

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.