Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cinema(input) {
- let type = input.shift();
- let row = Number(input.shift());
- let columns = Number(input.shift());
- let ticketPrice = 0;
- if (type == "Premiere") {
- ticketPrice = 12;
- price = row * columns * ticketPrice;
- } else if (type == "Normal") {
- ticketPrice = 7.50;
- price = row * columns * ticketPrice;
- } else if (type == "Discount") {
- ticketPrice = 5.00;
- price = row * columns * ticketPrice;
- }
- console.log(price.toFixed(2) + " leva");
- }
- cinema(["Normal", 21, 13]);
Advertisement
Add Comment
Please, Sign In to add comment