Advertisement
Spocoman

01. Trapeziod Area

Dec 8th, 2021
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function trapezoid(input) {
  2.     let b1 = parseFloat(input[0]);
  3.     let b2 = parseFloat(input[1]);
  4.     let h = parseFloat(input[2]);
  5.     let result = (b1 + b2) * h / 2;
  6.     console.log(`${result.toFixed(2)}`)
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement