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
how to make a venn diagram?

Jack and his mother paid $11.50 for tickets to the movies, and adults tickets cost $4.50 more than a child ticket what was the cost of each ticket?

#question.mario has 3 nickelsin his pocket.wha fraction ofadolla do 3 nickels represent

7 is what percent of 105?.


Partial Fractions - Integration techniques In this part we are going to take a look at integrals of rational expressions of polynomials and again let's start this section out w

the automatic hopper loader is set to put 36 tons of coal in each car. the actual weights of coal loaded into each car arw normally distributed with a mean of 36 tons and a standar

what is the difference between North America''s part of the total population and Africa''s part

find the value of x for which the distance between the points p(4,-5) and q(12,x) is 10 units

can you help me? cause im in 7th grade advanced math and tomorrow I have a test tomorrow and I don''t get this