Question: Using Matlab Write a script that calculates the volume of a container with a circular base of radius 8 meters and height of 8 meters.
Using Matlab
Write a script that calculates the volume of a container with a circular base of radius 8 meters and height of 8 meters. The script should prompt the user to input the type of container, and should accept the following container types (as strings): cylinder, cone, and dome. If an invalid option is entered, the script should return an ERROR that reads: Unhandled container type!. Once the type of container is specified by the user, the script should select the appropriate formula for calculating the containers volume, and display the final answer with a precision of 2 decimal places.
Volume formulas: Cylinder: V = r2h Cone: V = 1 3 r2h Dome: V = 2 3 r3 (half of a sphere)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
