Advertisement
Spocoman

Fish Land

Feb 22nd, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function fishLand(input) {
  2.     let mackerelPrice = Number(input.shift());
  3.     let spratPrice = Number(input.shift());
  4.     let bonitoFishKg = Number(input.shift());
  5.     let saffronKg = Number(input.shift());
  6.     let shellKg = Number(input.shift());
  7.  
  8.     let bonitoFishSum = bonitoFishKg * mackerelPrice * 1.60;
  9.     let saffronSum = saffronKg * spratPrice * 1.80;
  10.     let shellSum = shellKg * 7.50;
  11.     let sum = bonitoFishSum + saffronSum + shellSum;
  12.    
  13.     console.log(`${sum.toFixed(2)}`);
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement