Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ticket Price

Given two variables age and day, write code to determine the ticket price as per the following rules :

  • For a child (age less than 12) the ticket price is always 50.

  • For a senior citizen(age greater than or equal to 65):

    i) if it is weekend (Saturday/Sunday) the price is 70.
    
    ii)if it is a  weekday the price is 80.
    
  • For everybody else the price is always 100.

let age = 21;
let day = 'Monday';
let price;  

//write your code here to determine the price for the given age and day.

console.log("Ticket price is " + price);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment