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 a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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