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

  Write a single command line that defines the variables

How do you write a single command line that defines the variables N=444, M=555, O as the product (multiple of N and M), and then echoes the value of O?

  Disaster recovery plan strategy for the organization

Utilizing your comprehensive security plan outline that is atttached as a guide, develop the business continuity and disaster recovery plan strategy for the organization. This is another piece that will go into the final paper

  What is a data warehouse and what are the benefits

What is a data warehouse and what are the benefits provided to management at all levels in your organization?

  Developed a blackjack game to read

Developed a Blackjack game to read/print the hint table as it was laid out in the hint text file via console mode.

  Analyze the benefits and drawbacks of the common criteria

"'Recall that criteria creep' is the process of refining evaluation requirements as the industry gains experience with them, making the evaluation criteria something of a moving target. (See Section 21.2.4.2.)

  Explain java data streams

Explain Java data streams. How do we move different types of data from one place to another in Java. What different types of data streams are there?

  Explain applications of pervasive computing

Which of the applications of pervasive computing do you believe are probable to gain greatest market acceptance over next few years? Why?

  Game changing technology

The Internet is considered a ‘game changing' technology. Discuss at least three reasons why this is true.

  Use a traditional for loop to process the array

Write a Java method which takes an integer array parameter and fills the array with random numbers between 1 and 1000, including 1 and 1000. Use a traditional for loop to process the array.

  Write a program to fetch state and marital status of 5 users

Write a program to fetch state and marital status of 5 users.

  Prolog sudoku

Write a Prolog program to solve the 6 by 6 Sudoku puzzle distributed in class. Do not use a solution downloaded from the Internet or elsewhere. Write your own. It should be designed along these lines

  Write a driver program with a main method to read in data

"Using the PetRecord class stored on the K: drive, write a driver program with a main method to read in data for five Pets and display the following data.

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