Question: Write a C++ program that will ask the user for a shape of a fish tank (rectangle, cylinder, cone, triangular prism, pyramid, and sphere). Use

Write a C++ program that will ask the user for a shape of a fish tank (rectangle, cylinder, cone, triangular prism, pyramid, and sphere). Use this information to calculate the volume and display the result in gallons to the screen.

Rectangle: V = l * w * h

Cylinder: V = (pi) * (r^2) * (h)

Cone: V = (1/3) * (pi) * (r^2)* (h)

Triangular Prism: V = (1/2) * (b) * (h) * (l)

Pyramid: V = (1/3) * (l) * (w) * (h)

Sphere: V = (4/3) * (pi) * (r^3)

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!