Area under curve, Mathematics

Assignment Help:
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);
}
}

Related Discussions:- Area under curve

Solve the recurrence relation, Solve the recurrence relation T ...

Solve the recurrence relation T (K) = 2T (K-1), T (0) = 1 Ans: The following equation can be written in the subsequent form:  t n - 2t n-1 =  0  Here now su

Developing an understanding of subtraction, DEVELOPING AN UNDERSTANDING O...

DEVELOPING AN UNDERSTANDING OF SUBTRACTION :  The process of subtraction is the reverse of that of addition. Adding more to a collection to make it bigger is just the reverse

Matrices, suppose you a business owner and selling cloth. the following rep...

suppose you a business owner and selling cloth. the following represents the number of items sold and the cost for each item. use matrix operation to determine the total revenue ov

Conditional probability - rules of probability, Conditional probability - R...

Conditional probability - Rules of Probability This is the probability associated with combinations of events but given that some prior result has already been achieved with o

Trapezoid rule - approximating definite integrals, Trapezoid Rule - Approxi...

Trapezoid Rule - Approximating Definite Integrals For this rule we will do similar set up as for the Midpoint Rule. We will break up the interval [a, b] into n subintervals of

Dot product - vector, Dot Product- Vector The other topic for discu...

Dot Product- Vector The other topic for discussion is that of the dot product.  Let us jump right into the definition of dot product. There is given that the two vectors a

Real numbers, how to present root numbers on a number line

how to present root numbers on a number line

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd