Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

=+ Is the time practical, based on the organization's resources?

Answered: 1 week ago