Find area and circumference of a circle

Assignment Help Basic Computer Science
Reference no: EM13803521

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. 

Function circleInfo() will ask for the radius and will return it. 

Function circleArea() will accept a parameter, the radius, and returns the area. 

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=1; 

case 2 if (flag==0) 

disp('you need to enter the radius first'); 

else area=circleArea(r); 

end 

Reference no: EM13803521

Questions Cloud

Which class provides prebuilt dialog boxes : Which class provides prebuilt dialog boxes that enable programs to display windows containing messages (such windows are called message dialogs)
What are the most important criticisms of boards of director : The strategic management process is activated by Boards and their top management teams and they have a CSR responsibility strategy to create. They also need to be involved in social auditing and social performance reporting as these are critical aspe..
A security strategy involves risk assessment. : A key part of designing a security strategy involves risk assessment. Our tolerance to risk determines what provisions need to be in place to keep our risk at a manageable level. What is the process to determine an acceptable level of risk and how do..
Analyze the key approaches that negotiation team should use : Analyze the key approaches that your negotiation team should use in order to research both the government negotiators attending the negotiation session and the government's overall operations.
Find area and circumference of a circle : 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 ..
Public schools are better socialized than home schooled : Normal 0 false false false EN-US X-NONE X-NONE who attend public schools ar..
Implications for various stakeholders : The presentation should conclude with supported specific recommendations as to how organisations and their accounting advisors should proceed in light of the analysis.
Appendix a for the grading rubric : The key to this assignment is to demonstrate your understanding of the topics, not to re-word the text or reference material. Please see Appendix A for the grading rubric on all written assignments.Please complete the scenario below following these g..
Write summary of article the internet as a metaphor for god : Write a summary of the article "The Internet As A Metaphor For God" by Charles Henderson. The virtual reality of religious life on the internet and discuss what you think are the potential positives and negatives of religion online.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Compare results search and identify any differences

There are several options of search engines, including Yahoo, Google, DogPile, and Maholo. Using the listed search engines above, search for something that interest you

  Generations of computer languages

Question 2 As discussed in class the computer memory can be divided in RAM and REM ,Question 3 URL stands for Universal Resource Locato.

  Identify potential weaknesses of quality web design company

Identify potential weaknesses from either the Aircraft Solutions or Quality Web Design Company. In this phase, you will choose either Aircraft Solutions or Quality Web Design as the company you will work with.

  Determine probability that contention ends on round k

Determine the probability that a contention ends on round k, and what is a mean number of rounds per contention period?

  The pc platform to the cell phone

Q3. Many games have been ported from the PC platform to the cell phone. Because of the screen size, however, they tend to be simpler and sometimes more abstract.

  Find the standard sop

Find the standard SOP (sum of product) and POS (product of sum) expression of the subsequent Boolean function. F(A,B,C,D) = A(B' + CD') + A'BC'

  What different computing platforms do use

What different computing platforms do you use in school , at work, and at home. In general, what platforms are best suited to which specific tasks. How is the way in which you use computers likely to change over the next few years because of chang..

  Create a legal sales contract for a purchased vehicle

This Application uses Microsoft Word Template to allow a car salesperson to create a legal sales contract for a purchased vehicle and provides a loan calculator to calculate monthly payments for the amount financed.

  Define the topic is e-business and e-commerce security

The Topic is E-business/e-commerce security, Graphics are allowed but do not apply for the minimum page count.

  Create a crud matrix to indicate the permissions

Create a CRUD matrix to indicate the permissions (read, insert, delete, modify) you would grant to different users of your database.

  Find the order of t

Let T(n) be the running time of Yum(n). Find the order of T (that is find a function f(n) such that T?0(f)). (Assume that the real arithmetic is carried out exactly and is not subject to floating point round off errors.)

  What value is read into the variables by the following code

What value is read into the variables by the following code?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd