Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calculateProfit(input){
- let event = input[0];
- let row = Number(input[1])
- let col = Number(input[2])
- function getSeats(r, c) {
- let result = r * c
- return result
- }
- let profit = 0;
- if (event === "Premiere") {
- profit = getSeats(row, col) * 12
- } else if (event === "Normal") {
- profit = getSeats(row, col) * 7.50
- } else if (event === "Discount") {
- profit = getSeats(row, col) * 5
- }
- console.log(`${profit.toFixed(2)} leva`)
- }
- //calculateProfit(["Premiere", "10", "12"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement