Advertisement
Guest User

03.Cone-from Data Types And Var- More Exerc - SoftUni

a guest
Aug 16th, 2019
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cone(radius, height) {
  2.     let formulaVol = ((((1 / 3) * Math.PI) * (Math.pow(radius, 2))) * height).toFixed(4);
  3.     let formulaArea = (Math.PI * radius * (radius + Math.sqrt(Math.pow(radius, 2) + Math.pow(height, 2)))).toFixed(4);
  4.  
  5.     console.log(`volume = ${Number(formulaVol)}`);
  6.     console.log(`area = ${Number(formulaArea)}`);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement