Question: Write a MATLAB program by hand using switch / case structure to computes the area of a circle and a triangle. Start by asking the

Write a MATLAB program by hand using switch/case structure to computes the area of a circle and a triangle. Start by asking the user to enter 1 to calculate area of circle and 2 to calculate area of triangle. Use switch/case statements (based on user inputs) and ask appropriate parameters to compute the area for each shape. For instance, for circle, you will need to ask for the radius, for the triangle you will need to ask user for the base and the height, then use the appropriate statements to show the area for the shape. Area of circle is pi& r2, and area of triangle is (12)**b**h. Use otherwise statement if the input is not a 1 or a 2.
Write a MATLAB program by hand using switch /

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 Programming Questions!