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
If 7sin 2 ?+3cos 2 ? = 4, show that tan? =   1/√3                      . Ans:    If 7 Sin 2 ? + 3 Cos 2 ? = 4 S.T. Tan?  1/√3 7 Sin 2 ? + 3 Cos 2 ? = 4 (Sin 2 ? + Cos 2 ?)

a ,b,c are complex numbers such that a/1-b=b/1-c=c-1-a=k.find the value of k

Limits At Infinity, Part II :  In this section we desire to take a look at some other kinds of functions that frequently show up in limits at infinity.  The functions we'll be di


Linear functions are of the form: y = a 0 + a 1 x 1 + a 2 x 2 + ..... + a n x n where a 0 , a 1 , a 2 ..... a n are constants and x 1 , x 2 ..... x n a

Here are four problems. Four children solved one problem each, as given below. Identify the strategies the children have used while solving them. a) 8 + 6 = 8 + 2 + 4 = 14 b)

Describe the Basic Concepts and Terminology? Somebody tells you that x = 5 and y = 3. "What does it all mean?!" you shout. Well here's a picture: This picture is what's

For the initial value problem y' + 2y = 2 - e -4t , y(0) = 1 By using Euler's Method along with a step size of h = 0.1 to get approximate values of the solution at t = 0.1, 0

Multiply and divide by root2, then root2/root2(sinx+cosx) = root2(sinx/root2 + cosx/root2) = root2(sinx cos45+cosx sin45) = root2(sin(x+45))

how to find basic intrest problems