Advertisement
Spocoman

04. Vegetable Market

Dec 8th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function vegetableMarket(input) {
  2.  
  3.     let vegetablesBg = parseFloat(input[0]);
  4.     let fruitsBg = parseFloat(input[1]);
  5.     let vegetablesKg = parseFloat(input[2]);
  6.     let fruitsKg = parseFloat(input[3]);
  7.  
  8.     let results =(((vegetablesBg * vegetablesKg) + (fruitsBg * fruitsKg)) / 1.94);
  9.     console.log(`${results.toFixed(2)}`)
  10.  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement