TOPICS: Using Classes and Objects MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM. 3. Write an application that reads the radius of a sphere then calculates and displays the circumference, volume and surface area. Use the following formulas, in which r represents the sphere’s radius. Print the output to four decimal places. Circumference = 2 π r Volume = 4/3 π r3 Surface Area = 4 π r2 Hint: Section 3.5 of the textbook describes the many methods of the Math class and how they are used. The Math class also contains pre-defined constants like π. Search on the web for how you can use these. Testing: Include test exhibits for inputs that you choose. Make sure you check the results either with a calculator or some other independent source. Hint: Try Google!
TOPICS: Using Classes and Objects
MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM.
3. Write an application that reads the radius of a sphere then calculates and displays the circumference, volume and surface area. Use the following formulas, in which r represents the sphere’s radius. Print the output to four decimal places.
Circumference = 2 π r
Volume = 4/3 π r3
Surface Area = 4 π r2
Hint: Section 3.5 of the textbook describes the many methods of the Math class and how they are used. The Math class also contains pre-defined constants like π. Search on the web for how you can use these.
Testing: Include test exhibits for inputs that you choose. Make sure you check the results either with a calculator or some other independent source. Hint: Try Google!
Step by step
Solved in 3 steps with 2 images