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
Get step-by-step solutions from verified subject matter experts
