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 out the x-y coordinates of the points in which the following parametric equations will have horizontal or vertical tangents. x = t 3 - 3t        y = 3t 2 - 9 Solut

what is $6500 jamaican dollars in european money if jamaican $160.13 = 1 european money

A printer which sells for $190 is on sale for 20% off. What is the sale price of the printer? The printer is 20% off. That means that it is 80% of its original price (100% - 2

Can you explain slope and Slope is measured as rise/run?

Logarithm Functions : Now let's briefly get the derivatives for logarithms.  In this case we will have to start with the following fact regarding functions that are inverses of ea

i would like answers to these questions i will give you as soon as possible

jack and his mother paid $11.50 for tickets to the movies. An adult''s ticket costs $4.50 more than a child''s ticket. What was the cost of each ticket?

Sketch the phase portrait for the given system. Solution : From the last illustration we know that the eigenvectors and eigenvalues for this system are, This tu

How to Multiplying Monomials? To multiply monomials: Step 1: Multiply the coefficients. Step 2: Multiply the like variables by adding their exponents. Step 3: Multiply ans

on april 26, jonh dough wrote a check#374 to Miller Pharmacy for $16.00 , is this a deposit or withdrawal