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
Step: 1
Get Instant Access to Expert-Tailored 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