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

  What actual bit strings would a computer transmit

When one computer is transmitting a message to another, the information is usually encoded in ASCII. What actual bit strings would a computer transmit to send the message HELLO, using ASCII with even parity?

  A power plant contains a scada

A power plant contains a SCADA (supervisory control and data acquisition) system controlling the distribution of electric power for a large military installation. The SCADA system contains both real-time sensor data and routine administrative informa..

  Packet-switched and circuit-switched

Packet-switched and circuit-switched are two standards utilized by wide area networks. In your Discussion Board posting of 4-6 paragraphs, address the following:

  Where each instruction is bits wide

A DMA module is transferring characters to main memory from an external device transmitting at 500,000 bits per second (bps). The processor can fetch instructions at the rate of 1 million instructions per second where each instruction is 64 bits w..

  Explaining use of information technologies to act ethically

When it comes to use of information technologies, it is frequently difficult to find out how to act ethically. Consider some of your own use of information technologies.

  Short paper on security plan

Submit a security plan to secure the organization's database. The security plan will be submitted to the CIO. The organization has many concerns about unauthorized access, since there have been reports that some confidential information has been a..

  Discuss where a computer stores its basic hardware

Discuss where a computer stores its basic hardware settings, why it does so, and what some of those settings are. Compare storage devices using four criteria: versatility, durability, speed, and capacity.

  Recognize all of the stakeholders comprised in the project

prepare a list of it project-based tasks in an organization where you have worked. if you have not worked in any

  Write a program that will read in a file of student academic

Write a program that will read in a file of student academic credit data and create a list of students on academic warning. The list of students on warning will be written to a file. Each line of the input file will contain the student name

  Write a program that contains a main function

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point numbers:

  Pipeline diagram for processor which has no forwarding

If the processor has no forwarding, how many cycles will one loop iteration take? show a pipeline diagram to support your answer.

  Use of authentication types techniques impact security

Explain how the use of authentication types techniques impact security

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