Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active May 31, 2021 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/c562bef541c7867316182fd9706fd16e to your computer and use it in GitHub Desktop.
Save McLarenCollege/c562bef541c7867316182fd9706fd16e to your computer and use it in GitHub Desktop.
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