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
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