Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function homework

Write a function named getTicketPrice() that accepts age and day as arguments and returns the ticket price base on the following rules.

  • Children (age <=12) the ticket price is always 50.
  • For senior citizens(age greater than or equal to 65) if it is weekend(Saturday/Sunday) the price is 70 and for other days the price is 80.
  • For anyone else the price is 100.
let age=35;
let day ="Monday";
function getTicketPrice(age,day){
// Write your code here

}
console.log(getTicketPrice(age,day));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment