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


when i couulate the formula f 64 divided by 65 how do i do this


Melisa and Jennifer threw a fiftieth birthday party for their father at a local restaurant. While the bill came, Melisa added a 15% tip of $42. Jennifer said in which the service w

1. 10 -2 is equal to 2. If 3n = 27, what is the value of (4n) + 1 3. What is 1/100 of 10000? 4. The formula C=5/9 x (F-32) converts Centigrade temperature from Fa

The amount of particulate matter left in solution during a filtering process is given by the equation p(n) = 500(2) -0.8n , where n is the number of filtering steps. Find the amoun


i need help trying make a presentation for my teacher

1/8 of the passengers of a train were children.If there were 40 children travelling in the train on a certain day,how many adults were there in that train that day?