Find the radius of the circle

Assignment Help C/C++ Programming
Reference no: EM13713029

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

(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.

Program- The program should then output the circle's radius, circumference, diameter, and area. Your program must have at least the given methods:

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

Part 2- 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.

Part 3- 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.)

Part 4- 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.)

Assume that Pi =3.1416

Can you show me how to write a proper code for this problem and how to complete it. Thanks

Reference no: EM13713029

Questions Cloud

Find the heat absorbed by the gas : A cylinder contains 23 moles of an ideal gas at a temperature of 300 K. The gas is compressed at constant pressure until the final volume equals 0.43 times the initial volume.
Describe why a brute-force attack does not work : Explain exactly why an exhaustive key search will not succeed even though sufficient computational resources are available. This is a paradox since we know that the OTP is unconditionally secure.
Program that counts the number of occurrences of lowercase : Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts.
Find the change in the internal energy of the gas : monatomic ideal gas undergoes an isothermal expansion at 300 K, as the volume increased from 0.03 m3 to 0.21 m3 the final pressure of the gas is 60 kPa.
Find the radius of the circle : The program should then output the circle's radius, circumference, diameter, and area. Your program must have at least the given methods - Find the radius of the circle, and returns the circle's radius.
What kelvin temperature does the rms speed : At what Kelvin temperature does the rms speed of the oxygen (O2) molecules in the air near the surface of the earth become equal to the escape speed from the earth.
Write a switch statement that assigns a string variable : Write a switch statement that assigns a String variable monthName with the months January, February, March, April, May, and June, ifmonthNum is 1, 2, 3, 4, 5, 6, accordingly.
Implementing the tic tac toe game : Write a graphical Java program implementing the Tic Tac Toe game - The program should play against a user. The user + program should start the game on alternate games.
Find volume charge density p : In a certain region of space, the electric field E?  Is uniform. Use Gauss's law to find volume charge density p in this region.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Design, write, and test a program

Design, write, and test a program that represents some of the aspects of a student

  Create a function gcd

Create a function gcd(a, b) that receives two integers and returns the greatest common denominator of the two integers.

  Write test program to call function several times for gcd

Greatest common divisor of two integers is largest integer which will evenly divide both integers. Implement this function in assembly language and write test program which calls function several times, passing it different values.

  A hierarchical jpeg encode decoder for greyscale images

This project is to develop a program that implements a hierarchical JPEG encoder/decoder for greyscale images.

  Q1 write a menu-driven program that maintains an address

q1. write a menu-driven program that maintains an address book using a linked list. the address book must supports the

  Create the need matrix

Creating a system having five process from p0 to p4 and five resource types.

  What do the loops print

What do the following loops print? Work out the answer by tracing the code, not by using the computer. a. int s = 1; for (int n = 1; n

  Program that would display a letter to a friend

Writing a c++ program that would display a letter to a friend? It should have a proper format like name, friends name, address.....etc

  Write two functions to be called by the main program

CSC250 Assignment. Write two functions to be called by the main program. One function is to calculate, in general, a truck's range, that is, the distance the truck can go on one tank of gas (we should probably say fuel. since the bigrig might use ..

  Use a define statement to create a constant

Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name.

  Child process to take the role of the number guesser

Write a program in C that takes a number between 1 and 1024 as input on the command line, and then forks a child process to take the role of the number guesser

  We can combine assignment statements

We can combine assignment statements, for-loops, and if statements to perform a wide range of tasks with lists. Suppose we have a bookstore with each book defined as follows: Book = namedtuple('Book', 'author title genre year price instock') , wher..

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