Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started