Question: I need help In Java, The examples are exactly that examples, the code should make it so the inputs and outputs match. The shape of

I need help

In Java,

I need help In Java, The examples are exactly that examples, the

code should make it so the inputs and outputs match. The shape

The examples are exactly that examples, the code should make it so the inputs and outputs match.

The shape of a bottle is approximated by two cylinders of radius r1 and r2 and heights h1 and h2, joined by a cone section of height h3. Using the formulas for the volume of a cylinder, V= r2h, and a cone section, V=3(r12+r1r2+r22)h, Write a program to compute the volume of the bottle, given r1,r2,h1,h2 and h3 Example1: Input: r1=5.6,r2=2.3,h1=12.3,h2=3.0,h3=3.6 Output: The volume of the cylinder is 1447.65 cubic cm. Example 2: Input: r1=6.5,r2=3.2,h1=10,h2=4,h3=5 Output: The volume of the cylinder is 1838.82 cubic cm. Example 3: Input: r1=10,r2=9.8,h1=21,h2=6.8,h3=9.75 Output: The volume of the cylinder is 11645.32 cubic cm

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!