Advertisement
teofarov13

Untitled

Jan 14th, 2023
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function vacation(group, type, day) {
  2.     let price;
  3.     if (type == "Students") {
  4.         if (day == "Friday") {
  5.             price = group * 8.45;
  6.         } else if (day == "Saturday") {
  7.             price = group * 9.80;
  8.         } else if (day == "Sunday") {
  9.             price=group*10.46
  10.         }
  11.         if (group >= 30) {
  12.             price *= 0.85;
  13.         }
  14.     } else if (type == "Business") {
  15.         if (day == "Friday") {
  16.             price = group * 10.90;
  17.         } else if (day == "Saturday") {
  18.             price = group * 15.60;
  19.         } else if (day == "Sunday") {
  20.             if (group >= 100) {
  21.                 group-=10;
  22.             }
  23.             price = group * 16;
  24.         }
  25.     } else if (type == "Regular") {
  26.         if (day == "Friday") {
  27.             price = group * 15;
  28.         } else if (day == "Saturday") {
  29.             price = group * 20;
  30.         } else if (day == "Sunday") {
  31.             price = group * 22.50;
  32.         }
  33.         if (group >= 10 && group <= 20) {
  34.             price *= 0.95;
  35.         }
  36.     }
  37.     console.log(`Total price: ${price.toFixed(2)}`);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement