Advertisement
Liliana797979

movie destination

Dec 24th, 2020
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function movieDestination(arg1, arg2, arg3, arg4) {
  2.     let budget = Number(arg1);
  3.     let destination = arg2;
  4.     let season = arg3;
  5.     let days = Number(arg4);
  6.     let totalPrice = 0;
  7.  
  8.    
  9.  
  10.         if (destination === "Dubai") {
  11.             let totalPrice = totalPrice * 0.70;
  12.         } else {
  13.             totalPrice;
  14.         }
  15.             switch (season) {
  16.                 case "Winter":
  17.                     totalPrice = totalPrice * 45000;
  18.                 "Summer"
  19.                     totalPrice = totalPrice * 40000;
  20.                     break;
  21.             }
  22.        if (destination === "Sofia") {
  23.         totalPrice = totalPrice * 0.25;
  24.        } else {
  25.            totalPrice;
  26.        }
  27.        switch (season) {
  28.            case "Winter":
  29.                totalPrice = totalPrice * 17000;
  30.            case "Summer":
  31.                totalPrice = totalPrice * 12500;
  32.                break;
  33.        }
  34.         "London"
  35.         switch (season) {
  36.             case "Winter":
  37.                 totalPrice = totalPrice * 24000;
  38.             case "Summer":
  39.                 totalPrice = totalPrice * 20250;
  40.                 break;
  41.         }
  42.    
  43.             if (budget >= totalPrice) {
  44.                 console.log(`The budget for the movie is enough! We have ${(budget - totalPrice).toFixed(2)} leva left!`);
  45.             } else if (budget < totalPrice) {
  46.                 console.log(`The director needs ${(totalPrice - budget)} leva more!`);
  47.             }
  48.     }
  49.  
  50. movieDestination("40000", "Sofia", "Winter", "20");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement