Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easterTrip(input) {
- let destination = input.shift()
- let dates = input.shift()
- let night = Number(input.shift());
- let sum = 0;
- switch (destination) {
- case "France":
- switch (dates) {
- case "21-23":
- sum += 30;
- break;
- case "24-27":
- sum += 35;
- break;
- case "28-31":
- sum += 40;
- break;
- }
- break;
- case "Italy":
- switch (dates) {
- case "21-23":
- sum += 28;
- break;
- case "24-27":
- sum += 32;
- break;
- case "28-31":
- sum += 39;
- break;
- }
- break;
- case "Germany":
- switch (dates) {
- case "21-23":
- sum += 32;
- break;
- case "24-27":
- sum += 37;
- break;
- case "28-31":
- sum += 43;
- break;
- }
- break;
- }
- console.log(`Easter trip to ${destination} : ${(sum * night).toFixed(2)} leva.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement