Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function oscarsWeekInCinema(input) {
- let movie = input[0];
- let hallType = input[1];
- let ticketsSold = Number(input[2]);
- let ticketPrice = 0;
- let income = ticketsSold * ticketPrice;
- switch (movie) {
- case "A Star Is Born":
- if (hallType === "normal") {
- income = ticketsSold * 7.50;
- } else if (hallType === "luxury") {
- income = ticketsSold * 10.50;
- } else {
- income = ticketsSold * 13.50;
- }
- break;
- case "Bohemian Rhapsody":
- if (hallType === "normal") {
- income = ticketsSold * 7.35;
- } else if (hallType === "luxury") {
- income = ticketsSold * 9.45;
- } else {
- income = ticketsSold * 12.75;
- }
- break;
- case "Green Book":
- if (hallType === "normal") {
- income = ticketsSold * 8.15;
- } else if (hallType === "luxury") {
- income = ticketsSold * 10.25;
- } else {
- income = ticketsSold * 13.25;
- }
- break;
- case "The Favourite":
- if (hallType === "normal") {
- income = ticketsSold * 8.75;
- } else if (hallType === "luxury") {
- income = ticketsSold * 11.55;
- } else {
- income = ticketsSold * 13.95;
- }
- default:
- break;
- }
- console.log(`${movie} -> ${income.toFixed(2)} lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment