Question
5) Write a JavaScript script that will ask the user to enter in the length of the side of a cube. (all the sides of
5) Write a JavaScript script that will ask the user to enter in the length of the side of a cube. (all the sides of a cube are equal) Based on the value that is entered by the user from the keyboard, calculate each of the following and assign your results to variables. 1. volume of the cube 2. surface area of the cube 3. volume of the largest sphere that could fit in the box. 4. surface area of the largest sphere that could fit in the box. 5. volume of the space in between the cube and the sphere. HINT: the largest sphere that could fit in the box will have a diameter equal to the side of the cube. ANOTHER HINT: to find the volume in between the cube and sphere you should subtract volumes. in case you forgot the sphere formulas, they are: volume of sphere = 4/3 Pi r3 surface area of sphere = 4 Pi r2 Your script should output HTML text that displays the results of your calculations.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started