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

  Formula translation

Write a c code that will evaluate the roots of a quadratic equation

  Write functions

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

  What is java adapter class

What is Java adapter class.

  Ruby program that continuously reads in number

Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its: factorial, if x is less than 15.

  Communicate with a pc using the rs232c serial protocol

In this assignment we will use the UART0 peripheral to communicate with a PC using the RS232C serial protocol.

  Explaining object hierarchy in object-oriented programming

Study the concept of inheritance and the object hierarchy in object-oriented programming, and write a paper comparing these concepts with the concept of inheritence.

  Definition of function quadratic receives double parameters

Write down definition of function named quadratic which receives 3 double parameters a , b , c . If value of a is 0 then function prints the message "no solution for a=0"

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Scripting language programming in perl

course Scripting Language Programming,  Assignment   -  Perl,  ? Your coding style should conform to general Perl coding conventions. Your scripts should be clean, neat, and well-formatted (e.g. indention). Identifiers should also be properly name..

  Accuracy and completeness of computations

Analysis right and you have to develop a plausible argument to "prove" that your analysis is correct

  Creating table-find employee attended meeting on given date

The rows of this table record the fact that an employee from a particular project attended a meeting on the given date.

  Php script to obtain url and its description from user

Write a PHP script to obtain URL and its description from user and stores information into database by using MySQL.

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