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
find the coordinates of points of tri-section of the line joining the points (-3,0) and (6,6).


i dont understand angels and lines


A juicer is available for 3500 cash but was sold under installment plan where the purchaser agreed to pay 1500 cash down and 3 equal quarterly installments. If the dealer charges i

One-sided limits: We do this along with one-sided limits.  As the name implies, with one-sided limits we will just looking at one side of the point in question.  Following are the

how to determine roman numerals to digits specially when it hundred thousands

Kristen earns $550 each week after taxes. She deposits 10% of her income in a savings account and 7% in a retirement fund. How much does Kristen have left after the money is taken

Example for Comparison Test for Improper Integrals Example:  Find out if the following integral is convergent or divergent. ∫ ∞ 2 (cos 2 x) / x 2 (dx) Solution

Any 15 foot ladder is resting against the wall. The bottom is at first 10 feet away from the wall & is being pushed in the direction of the wall at a rate of 1 ft/sec. How rapid is