Advertisement
dimoBs

Untitled

Oct 13th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. function solve(input1, input2, input3) {
  2. let destination = input1;
  3. let dates =""+input2;
  4. let nights = Number(input3);
  5. let spendMoneyForExursion = 0;
  6. let priceDestionation = 0;
  7.  
  8. switch (destination) {
  9. case "France":
  10. if (dates == "21 - 23") {
  11. priceDestionation = 30;
  12. } else if (dates == "24 - 27") {
  13. priceDestionation = 35;
  14. } else if (dates == "28 - 31") {
  15. priceDestionation = 40;
  16. }
  17. break;
  18. case "Italy":
  19. if (dates = 21 - 23) {
  20. priceDestionation = 28;
  21. } else if (dates == "24 - 27") {
  22. priceDestionation = 32;
  23. } else if (dates == "28 - 31") {
  24. priceDestionation = 39;
  25. }
  26. break;
  27. case "Germany":
  28. if (dates == "21 - 23") {
  29. priceDestionation = 32;
  30. } else if (dates == "24 - 27") {
  31. priceDestionation = 37;
  32. } else if (dates == "28 - 31") {
  33. priceDestionation = 43;
  34. }
  35. break;
  36. }
  37. spendMoneyForExursion = (priceDestionation * nights).toFixed(2);
  38.  
  39. console.log(`Easter trip to ${destination} : ${spendMoneyForExursion} leva.`);
  40. }
  41. //solve("Germany", 24 - 27, 5);
  42. // solve("Italy",
  43. // 21-23,
  44. // 7)
  45. solve("France", "28 - 31", 8);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement