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

  You are asked to write a simple driver program

In this assignment in c, you are asked to write a simple driver program and set of functions (maybe in a library) that can be performed on a binary search tree. Your program should allow user to insert/delete integer values into the binary search ..

  Prepare a new int[] variable and inititialize it

Prepare a new int[] variable and inititialize it to be a new int array with the given size to create random values use the random class import javautil.random inside the method create a new instance with: Random rand = new Random();

  Create a function that will accept a scalar value

Create a function that will accept a scalar value for the radius of the cylinder and end caps and will accept an array for the height of the cylinder.

  Machine that i would like to know

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..

  In c++, write a program that calculates 10,000 tries.

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..

  Reads a line of characters from the user

Write a segment of code (not an entire program) that reads a line of characters from the user and outputs "too long" if the user enters more than 5 characters (not counting hitting the enter/return key).

  Write a program that calculates an employees wage for a

write a program that calculates an employees wage for a week. an employees wage is calculated as followsi if the number

  Program that asks user to enter the size of the matrix

Write a program that asks user to enter the size of the matrix (rows and column) then, it asks the user to enter the elements of two matrices and finally it adds two matrix and displays the result in C language.

  Setup a class to store a book

Setup a class to store a book. The data is to include title, author, year of publication, dewey number and age.

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

  Write a webservices application that does a simple four

write a webservices application that does a simple four function calculator. write a cgi program launched by your

  Assume that you are tasked with tracking the orders which

loops and nested loops please respond to the followingbullsuggest one 1 example of a problematic programming situation

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