Question: Matlab please and do the modify the areaMenu script to use a switch statement to decide which area to calculate that is the part I

 Matlab please and do the modify the areaMenu script to use

Matlab please and do the modify the areaMenu script to use a switch statement to decide which area to calculate that is the part I need

25. Write a script areaMenu that will print a list consisting of " cylinder," "circle." and "rectangle." It prompts the user to choose one, and then prompts the user CHAPTER 4: Selection Statements for the appropriate quantities (e.g., the radius of the circle) and then prints its area. If the user enters an invalid choice, the script simply prints an error mes- sage. The script should use a nested if-else statement to accomplish this. Here are two examples of running it (units are assumed to be inches). >> areaMenu Menu 1. Cylinder 2. Circle 3. Rectangle Please choose one: 2 Enter the radius of the circle: 4.1 The area is 52.81 >> areaMenu Menu 1. Cylinder 2. Circle 3. Rectangle Please choose one : 3 Enter the length: 4 Enter the width: 6 The area is 24.00 Modify the areaMenu script to use a switch statement to decide which area to calculate

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