Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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