Question: JAVA PROGRAMMING: use the JOptionPane class Write an application (Sphere) that gets the radius (r) of a sphere from a user ( do not use

JAVA PROGRAMMING: use the JOptionPane class

Write an application (Sphere) that gets the radius (r) of a sphere from a user (do not use the Scanner class, USE JOptionPane class) and then prints out its volume and surface areas (to four decimal places, but if they are trailing zeros, do not print). For pi, use the Math.PI method. Use the following formulas:

Volume = 4/3(r3) Surface area = 4r2

Finally, figure out what percentage the surface area is to the volume (in other words, divide the surface area by the volume). Ensure the percentage is in the correct format by using NumberFormat class. Print this out.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!