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
Let {An} be sequence of real numbers. Define a set S by: S={i ? N : for all j > i, ai

Prove the subsequent Boolean expression: (x∨y) ∧ (x∨~y) ∧ (~x∨z) = x∧z Ans: In the following expression, LHS is equal to:   (x∨y)∧(x∨ ~y)∧(~x ∨ z) = [x∧(x∨ ~y)] ∨ [y∧(x∨

prove the the centre of a circle is twice of reference angle

What is Modulo Arithmetic and what is an easy way to remember it?

trigonometric ratios of sum and difference of two angles

A telephone company charges $.35 for the first minute of a phone call and $.15 for each additional minute of the call. Which of the subsequent represents the cost y of a phone call

Q. Find the number of ways three letter "words" can be chosen from the alphabet if none of the letters can be repeated? Solution:  There are 26 ways of choosing the first lett


how to solve this question:(2x)5*(2x)-4*(2x)-3*(2x)6

Negative four is multiplied through the quantity x + 8. If 6x is then added to this, the output is 2x + 32. What is the value of x? twice the quantity x + 6 is divided by negative