Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input1, input2, input3) {
- let destination = input1;
- let dates =""+input2;
- let nights = Number(input3);
- let spendMoneyForExursion = 0;
- let priceDestionation = 0;
- switch (destination) {
- case "France":
- if (dates == "21 - 23") {
- priceDestionation = 30;
- } else if (dates == "24 - 27") {
- priceDestionation = 35;
- } else if (dates == "28 - 31") {
- priceDestionation = 40;
- }
- break;
- case "Italy":
- if (dates = 21 - 23) {
- priceDestionation = 28;
- } else if (dates == "24 - 27") {
- priceDestionation = 32;
- } else if (dates == "28 - 31") {
- priceDestionation = 39;
- }
- break;
- case "Germany":
- if (dates == "21 - 23") {
- priceDestionation = 32;
- } else if (dates == "24 - 27") {
- priceDestionation = 37;
- } else if (dates == "28 - 31") {
- priceDestionation = 43;
- }
- break;
- }
- spendMoneyForExursion = (priceDestionation * nights).toFixed(2);
- console.log(`Easter trip to ${destination} : ${spendMoneyForExursion} leva.`);
- }
- //solve("Germany", 24 - 27, 5);
- // solve("Italy",
- // 21-23,
- // 7)
- solve("France", "28 - 31", 8);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement