0

Function in JavaScript

How do I prompt a user for the radius of a sphere and then create a function to calculate the circumference and volume of the sphere using a pi constant. Then display the result

3rd Apr 2018, 6:59 PM
love
3 odpowiedzi
+ 2
https://www.w3schools.com/jsref/met_win_prompt.asp ^Get radius. https://www.w3schools.com/js/js_functions.asp ^Functions in JS. https://formulas.tutorvista.com/math/sphere-formula.html ^Formulas for spheres. https://www.w3schools.com/js/js_output.asp ^Display results. The stuff above should help teach you all of the things you need to accomplish your task. Hope it helps and best of luck in your learning! :)
3rd Apr 2018, 7:12 PM
Fata1 Err0r
Fata1 Err0r - avatar
0
Yea it does. But do you know how I can use the square root function in my code?
3rd Apr 2018, 7:24 PM
love
0
Math.sqrt(x) gives the square root of x
3rd Apr 2018, 11:06 PM
Bebida Roja
Bebida Roja - avatar