Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions