Program to output circle-s radius-diameter-circumference

Assignment Help Programming Languages
Reference no: EM1349013

Q1) The following formula gives the distance between two points (x1, y1) and (x2, y2) in the Cartesian plane:

sqrt (x2-x1)^2 + (y2-y1)^2

Given the center and a point on a circle, you can use this formula to find the radius of a circle. Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle's radius, diameter, circumference, and area. Your program must have at least the following methods:

a. distance: This method takes as its parameters four numbers that represent two points in the plane and returns the distance between them.

b. Radius: This method takes as its parameter four numbers that represent the center and a point on the circle, calls the method distance to find the radius of the circle, and returns the circle's radius.

c. Circumference: This method takes as its parameter a number that represents the radius of the circle and returns the circle's circumference. (if r is the radius, the circumference is 2(Pi)r.)

d. Area: This method takes as its parameter a number that represents the radius of the circle and returns the circle's area. (If r is the radius, the area is (Pi)r^2.)

e. Assume that Pi =3.1416

Reference no: EM1349013

Questions Cloud

Question on material quantity variance : The following materials standards have been established for a particular product: What is the materials quantity variance for the month?
Psychological theory to offender behavior : How do you apply a psychological theory to offender behavior? (i.e., schizophrenia).
Explain difference between differential & financial analysis : A frequent activity in managerial accounting is differential analysis. Differential analysis is about relevant costs for decision making in management accounting.
Describe the court''s use of this new standard : Describe the Court's use of this new standard and its impact on enforcement of Title VII.
Program to output circle-s radius-diameter-circumference : Write a program to prompt the user to enter center and a point on circle. Program must then output circle's radius, diameter, circumference, and area.
Estimated costs and cost per unit needed : or what other business decisions may it be impossible to calculate the actual cost? What are some of the dangers of basing decisions on estimated rather than actual costs? How might these dangers be minimized?
At what rate it emit energy by radiation : A 11 g bullet is fired horizontally into a 109 g wooden block that is initially at rest on a frictionless horizontal surface and connected to a spring having spring constant 142 N/m. The bullet becomes embedded in the block.
Explain what information should be included in a written : Explain What information should be included in a written positioning statement for Mary Kay and Is Mary Kay a global brand?
Financial management theory : More of financial management theory is based on assumption that individuals act rationally in their decision making. text has noted several areas where conclusion is that individuals do not act rationally.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write the code required to analyse and display

Engineer for a materials manufacturing research lab and have been asked to provide an automated solution to analyse data.

  Write the constructor function makestk

Write the constructor function makestk, predicate function emptystk and mutator functions pushstk and popstk

  Program for insertion sort and selection sort algorithms

Write a program involving the insertion sort, merge sort and selection sort algorithms.

  Create child processes

Create child processes

  Computing return value after execution of program

Compute return value of Antony after its execution?

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

  Wilkerson-irwin algorithm to minimize mean tardiness

Write a program to implement the Wilkerson-Irwin algorithm to minimize mean tardiness.

  Creating message box to display member name

Ddefine for your class is a method to design a message box to display member name, car year and model, and year member joined club.

  C program to accept three numbers inputs by user

Write down C program to accept three numbers input by a user, and outputs a table of temperatures in Fahrenheit, Celsius, and Kelvin.

  Explaining law of diminishing returns

As computer word size gets larger and larger, there is a law of diminishing returns; speed of execution of application programs doesn't increase and may, in fact, decrease.

  Using the irvine32 library functions

Create 32 random points which have (x, y) co-ordinates

  Program to inputs four numbers and graphs them as pie chart

Write down a program which inputs four numbers and graphs them as pie chart.

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