Question: Write a Java Code.You are working in a company specialized in filling up different cylinder canes with different volumes. Your employer is asking you to

Write a Java Code.You are working in a company specialized in filling up different cylinder canes with different volumes. Your employer is asking you to write a program that will actually ask from the user to inter the volume that he is wishing to have and the different measures of the cylinder, then it will both calculate and then compare between them. If the volume entered is inferior to the one of the cane, give how much he should add, if they are equal, the output should be 0, if it is superior give him how much he should remove. Note that the numbers should be rounded to 3 decimals in the output.

(Volume of the cylinder=pi*r^2*h, pi=3.14)

Input Format

3 inputs 2 of them is integer for radius and height, last one is double for volume of the water.

Constraints

0<= Inputs<=40

Output Format

You must print one line of output:

A float number print 3 digits after the floating point. + in front of output volume of the cylinder is more than water -in front of output volume of the cylinder is less than water

Sample Input 0

1 1 4 

Sample Output 0

-0.860

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!