Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

Identify four applications of HRM to healthcare organizations.

Answered: 1 week ago