Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function movieDestination(arg1, arg2, arg3, arg4) {
- let budget = Number(arg1);
- let destination = arg2;
- let season = arg3;
- let days = Number(arg4);
- let totalPrice = 0;
- if (destination === "Dubai") {
- let totalPrice = totalPrice * 0.70;
- } else {
- totalPrice;
- }
- switch (season) {
- case "Winter":
- totalPrice = totalPrice * 45000;
- "Summer"
- totalPrice = totalPrice * 40000;
- break;
- }
- if (destination === "Sofia") {
- totalPrice = totalPrice * 0.25;
- } else {
- totalPrice;
- }
- switch (season) {
- case "Winter":
- totalPrice = totalPrice * 17000;
- case "Summer":
- totalPrice = totalPrice * 12500;
- break;
- }
- "London"
- switch (season) {
- case "Winter":
- totalPrice = totalPrice * 24000;
- case "Summer":
- totalPrice = totalPrice * 20250;
- break;
- }
- if (budget >= totalPrice) {
- console.log(`The budget for the movie is enough! We have ${(budget - totalPrice).toFixed(2)} leva left!`);
- } else if (budget < totalPrice) {
- console.log(`The director needs ${(totalPrice - budget)} leva more!`);
- }
- }
- movieDestination("40000", "Sofia", "Winter", "20");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement