Liliana797979

theatre promotions - fundamentals

Mar 19th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function theatrePromotions(day, age) {
  2.     if (age >= 0 && age <= 18) {
  3.         switch (day) {
  4.             case "Weekday":
  5.                 console.log(`12$`);
  6.                 break;
  7.             case "Weekend":
  8.                 console.log(`15$`);
  9.                 break;
  10.             default:
  11.                 console.log(`5$`);
  12.         }
  13.         } else if (age > 18 && age <= 64) {
  14.             switch (day) {
  15.                 case "Weekday":
  16.                     console.log(`18$`);
  17.                     break;
  18.                 case "Weekend":
  19.                     console.log(`20$`);
  20.                     break;
  21.                 default:
  22.                     console.log(`12$`);
  23.             }
  24.             } else if (age > 64 && age <= 122) {
  25.             switch (day) {
  26.                 case "Weekday":
  27.                     console.log(`12$`);
  28.                     break;
  29.                 case "Weekend":
  30.                     console.log(`15$`);
  31.                     break;
  32.                 default:
  33.                     console.log(`10$`);
  34.             }  
  35.         } else {
  36.                 console.log(`Error!`);
  37.             }
  38.     }
  39.  
  40.  
  41. theatrePromotions("Weekday", 42);
Advertisement
Add Comment
Please, Sign In to add comment