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
A speaks truth in 80% of the cases and B speaks truth in 60% of the cases.  Find out the probability of the cases of which they are possible to contradict each other in stating sim

Bill spent 50% of his savings on school supplies, and then he spent 50% of what was left on lunch. If he had $6 left after lunch, how much did he have in savings at the starting?

Find out the linear approximation for at x =8 .  Utilizes the linear approximation to approximate the value of  and Solution Since it is just the tangent line there

why is a complimentary angle 90 degres

Cylindrical Coordinates - Three Dimensional Space Since with two dimensional space the standard (x, y, z) coordinate system is known as the Cartesian coordinate system.  In the

Solve the subsequent differential equation and find out the interval of validity for the solution. Let's start things off along with a fairly simple illustration so we can notic

Calculate the slope of the line: Example: calculate  the  slope  of  the  line  whose  equation  is  y  =  2x  +  3  and  whose y-intercept is (0,3). Solution:    y =

Simplify following and write the answers with only positive exponents.   (-10 z 2 y -4 ) 2 ( z 3 y ) -5 Solution    (-10 z 2 y -4 ) 2 ( z 3 y ) -5

Find the number of square feet of pavement required for the shaded portion of the streets shown in the figure, all the streets being 50 feet wide.

A die is rolled twice and the sum of the numbers appearing on them is observed to be 7.What is the conditional probability that the number 2 has appeared at least once? A) 1/3