Question: 2. Write a Matlab program that will allow the user to find area and circumference of a circle. Selections and data entry will be done

 2. Write a Matlab program that will allow the user to

2. Write a Matlab program that will allow the user to find area and circumference of a circle. Selections and data entry will be done by presenting the user with a menu (using menu function) and provide her/him with the following choices: Enter the radius . Display the area Display the circumference Exit Other Requirements: . Selecting choice 2 or 3 before entering the radius will result in an error message The program will terminate only when Exit has been selected Calculations will be done by functions. o Function circlelnfo will ask for the radius and will return it. o Function circleArea) will accept a parameter, the radius, and returns the area o Function circleCircum() will accept a parameter, the radius, and returns the circumference Results are displayed with 2 decimal place accuracy Partial Help with the menu: flag -0; Calculation while (1) choice-menu 'Circle and Cylinder', "Enter the radius', 'Display the area', Display the circumference', 'Exit') switch (choice) case 1 r-circleInfo (); flag-l; if (flag--0) else case 2 disp ('you need to enter the radius first'); area-circleArea (r); end

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!