Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ticket Price Child Adult

Given a person's age and a day ,write the code for the following scenario:

If the person is an Adult (age >=18) , the ticket price on Weekends is 100 and on weekdays is 80.

If the person is a child (age <18), the ticket price is always half of the adult price for that particular day.

let age = 15;
let day = "Sunday";
let price ;
// write your logic here to determine the price
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment