ProdanTenev

Cinema

Feb 12th, 2022 (edited)
1,318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.41 KB | None | 0 0
  1. function cinemaCash(input) {
  2.     let type = input[0];
  3.     let rows = Number(input[1]);
  4.     let col = Number(input[2]);
  5.     let totalSum = 0;
  6.     if (type == "Premiere") {
  7.         totalSum = (rows * col) * 12;
  8.     } else if (type == "Normal") {
  9.         totalSum = (rows * col) * 7.50;
  10.     } else if (type == "Discount") {
  11.         totalSum = (rows * col) * 5;
  12.     }
  13.     console.log(totalSum.toFixed(2));
  14. }
Add Comment
Please, Sign In to add comment