Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function filmPremiere(input) {
- let projection = input[0];
- let moviePackage = input[1];
- let ticketsCount = Number(input[2]);
- let price = 0;
- switch (projection) {
- case "John Wick":
- switch (moviePackage) {
- case "Drink":
- price = ticketsCount * 12;
- break;
- case "Popcorn":
- price = ticketsCount * 15;
- break;
- case "Menu":
- price = ticketsCount * 19;
- break;
- }
- break;
- case "Star Wars":
- switch (moviePackage) {
- case "Drink":
- price = ticketsCount * 18;
- break;
- case "Popcorn":
- price = ticketsCount * 25;
- break;
- case "Menu":
- price = ticketsCount * 30;
- break;
- }
- break;
- case "Jumanji":
- switch (moviePackage) {
- case "Drink":
- price = ticketsCount * 9;
- break;
- case "Popcorn":
- price = ticketsCount * 11;
- break;
- case "Menu":
- price = ticketsCount * 14;
- break;
- }
- break;
- }
- if (projection === "Star Wars" && ticketsCount >= 4) {
- price = price * 0.70;
- }
- if (projection === "Jumanji" && ticketsCount === 2) {
- price = price * 0.85;
- }
- console.log(`Your bill is ${(price).toFixed(2)} leva.`);
- }
- filmPremiere(["John Wick", "Drink", "6"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement