Advertisement
Guest User

8. Cylinder Volume

a guest
Jul 23rd, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function calcCylinderVol(value) {
  2.     var radius = value[0];
  3.     var height = value[1];
  4.     var volume = Math.PI * radius * radius * height;
  5.     return volume.toFixed(3);
  6. }
  7.  
  8. console.log(calcCylinderVol([2, 4]));
  9. console.log(calcCylinderVol([5, 8]));
  10. console.log(calcCylinderVol([12, 3]));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement