Question: Part 1 : Working with Expressions ( 1 0 pts ) Description Write a Java program to do the following: 1 . Prompt the user

Part 1 : Working with Expressions
(10 pts)
Description
Write a Java program to do the following:
1. Prompt the user to enter the diameter of a sphere.
2. Read in and store the number into a variable called diameter (declare as int).
3. Calculate and store the radius in an appropriately named variable (declare as double). Note: the diameter is twice as long as the radius.
4. Define a constant and name it PI to store the value of the 3.14.
5. Compute the volume of a sphere and store the value in an appropriately named variable. Use the following formula:
Note: Dont use any Math methods.
6. Print your results to the screen with an appropriate message.
7. Compile, debug, and run using the following test data and record the results.

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 Programming Questions!