silvana1303

theatre promotions

Apr 5th, 2021
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ticket(weekday, age){
  2.    if (weekday == 'Weekday'){
  3.  
  4.        if (age >= 0 && age <= 18){
  5.            console.log('12$');
  6.        } else if(age <= 64){
  7.            console.log('18$');
  8.        } else if (age <= 122) {
  9.            console.log('12$');
  10.        } else {
  11.            console.log('Error!')
  12.        }
  13.    } else if(weekday == 'Weekend') {
  14.        if (age >= 0 && age <= 18){
  15.            console.log('15$');
  16.        } else if(age <= 64){
  17.            console.log('20$');
  18.        } else if (age <= 122) {
  19.            console.log('15$');
  20.        } else {
  21.            console.log('Error!')
  22.        }
  23.    } else {
  24.        if (age >= 0 && age <= 18){
  25.            console.log('5$');
  26.        } else if(age <= 64){
  27.            console.log('12$');
  28.        } else if (age <= 122) {
  29.            console.log('10$');
  30.        } else {
  31.            console.log('Error!')
  32.        }
  33.    }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment