Advertisement
Spocoman

06. Fishland

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