Area under curve, Mathematics

w/ You could use this sample code to test your C functions
// Please make appropriate changes to use this for C++.

// Following main function contains 3 representative test cases

int main() {
// test case 1
{
int noOfTerms = 2;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent = 1;
equation[0].coefficient = 1;

equation[1].exponent = 2;
equation[1].coefficient = 3;

int limit1 = 4;
int limit2 = 8;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);

}

// test case 2
{
int noOfTerms = 1;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent =1;
equation[0].coefficient = 1;

int limit1 = 1;
int limit2 = 1;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);

}

// test case 3
{
int noOfTerms = 1;
struct Term *equation = (struct Term*)malloc(sizeof(struct Term) * noOfTerms);
equation[0].exponent =1;
equation[0].coefficient = 1;

int limit1 = 2;
int limit2 = 1;

double usrout = getAreaUnderCurve(equation, noOfTerms, limit1, limit2);
printf("%lf", usrout);
}
}
Posted Date: 8/31/2012 1:07:21 AM | Location : United States







Related Discussions:- Area under curve, Assignment Help, Ask Question on Area under curve, Get Answer, Expert's Help, Area under curve Discussions

Write discussion on Area under curve
Your posts are moderated
Related Questions
Hydrostatic Pressure and Force - Applications of integrals In this part we are going to submerge a vertical plate in water and we wish to know the force that is exerted on t

What are directional derivatives? Explain with two or more examples..


How do I solve this problem: Manuel is a cross-country runner for his school’s team. He jogged along the perimeter of a rectangular field at his school. The track is a rectangle th

Identify the flaw in the following argument which supposedly determines that n 2 is even when n is an even integer. As well name the reasoning:             Assume that n 2 is

In triangle ABC if angle B = 90 degrees what is the value Tan A/2 in terms of its sided? Solution) tanA=c/b let tan(A/2)=x 2x/(1-x 2 )=c/b,solve for x

What is minimum spanning tree?  Determine a railway network of minimal cost for the cities in the following graph using Kruskal's algorithm. Ans: Minimum spanning tree in a con

1.   The length of a rectangle is 2 times its width.  The area of the rectangle is 72          square inches. Find the dimensions of the rectangle.   2.   The length of a rec

A 25 foot ladder just reaches the top of a house and forms an angle of 41.5 degrees with the wall of the house. How tall is the house?

write the equation of parabola of vertex(2,-3)and focus(_1,1)