Monday, October 31, 2011

Lab 11 - circle calculations

As one of the requirements to earn a B- or higher, you must complete exercise 6 on pp 341-342, which requires you to solve a set of problems regarding the calculation of properties of a circle.

You need to write three functions; these are their headers:

   double radius(double x1, double y1,
                 double x2, double y2)
   double circumference(double r)
   double area(double r)


The user should be prompted to enter four values (doubles), representing two points in the Cartesian coordinate system: x1, y1, x2, and y2.

You need to pass the four values to the radius function in order to calculate the distance between them. The mathematical equation you will need to implement is:
How to calculate the distance between
two points (x1, y1) and (x2, y2)

The best way to solve this problem is to call both the pow and sqrt functions inside radius.

The names of the other two functions should make their purposes self-explanatory.

Sample Output
Here is a screenshot of my code running.


Refer to the deliverables post for comment formatting and required program identification information.

Due Date:
Sunday, November 6th, 6:00pm