Question: Using a text editor such as notepad, create a Java program, that solves for the circumference of a circle, area of a circle, and volume
Using a text editor such as notepad, create a Java program, that solves for the circumference of a circle, area of a circle, and volume of a sphere, given an input radius from the user.
- The circumference of a circle is 2 times pi times radius. (2 * Pi * r)
- The area of a circle is pi times radius squared. (Pi*r^2)
- The volume of a sphere is 4/3 times pi times radius to the third power. (4/3 * Pi * r^3)
- You may use Math.PI for the value of Pi
- You may use Math.pow(value, exponent) for your power math.
- accept from the user a Real number
- Limit the display of the numbers in the output to 3 decimal places.
Compile and run the program from the command prompt.
example:
Please enter the radius of a circle/sphere and I will calculate the circumference and area of the circle, and the volume of the sphere.
3.00
The circumference of the circle with a radius of 3.000 is 18.850 The area of the circle with a radius of 3.000 is 28.274 The volume of a sphere with a radius of 3.00 is 113.097
When you have finished this practical, submit your .java file for this question
Submit our .class file and a screen shot of the program running in the command prompt in the next two questions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
