448,537 Members | 873 Online Need help? Post your question and get tips & solutions from a community of 448,537 IT Pros & Developers. It's quick & easy.

# program to find the dimensions of a circle

 P: 2 Given the center and a point on the circle, you can use this formula to find the radius of the 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 functions: a. distance: This function takes as its parameters four numbers that represent two points in the plane and returns the distance between them. b. Radius : This function takes as its parameters four number that represent the center and a point on the circle, calls the function distance to find the radius of the circle. and returns the circles radius. c. Circumference : This function 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 π r) d. Area: This function 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 π r2 ) Assume that π = 3.1416 May 18 '07 #1
9 Replies

 Expert 2.5K+ P: 3,652 Interesting problem. Were you having trouble with this? Did you have a program that you were getting errors on? Trouble understanding the problem? We can't help you if you won't help yourself. May 18 '07 #2

 100+ P: 208 Sounds like a program I did in my first programmer coures :P It's really not hard. There's algorithms on the net May 18 '07 #3

 P: 2 i dont now any thing May 18 '07 #4

 100+ P: 208 WEll think about this for a moment..Now...I'm assuming when you say the user enters the center and another point that this second point is on the edge of the circle (It has to be unless you're given a ratio of where it's located (e.g. the point is 2/3 away from the center)). Anyways...Given the center and a point on the edge it's really easy to calculate the radius and diameter....Just calculate the length of the line... May 18 '07 #5

 Expert 100+ P: 1,251 i dont now any thing I'm sorry? I think you know a lot more than you realise. You've got your problem, now tell me what steps you need to do to solve it. Don't post code at this point. Assume that the computer is a person that will follow instructions. You talk to the person as input, the person does something and then talks back for output. Now, what you need to think about is:what are you going to say to the person? what is the person going to have to do (i.e. what calculations will it need to do)? what is the person going to say to you? Frame your solution like: person says, "What is the mass in grams?" you say, "" person stores m= person calculates E=m*(c^2) where ^ means to the power of person says "The energy in " m " grams is " E " Joules" Adrian May 18 '07 #6

 Expert 2.5K+ P: 3,235 i dont now any thing LOL. In that case, you need more help than this forum will be able to provide. May 18 '07 #7

 Expert Mod 10K+ P: 14,534 The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Please read the Posting Guidelines and particularly the Coursework Posting Guidlines. ADMIN May 19 '07 #8 