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

Functions , For the layman, a "function" indicates a relationsh...

For the layman, a "function" indicates a relationship among objects. A function provides a model to describe a system. Economists refer to deman

Assignment, Is there any assignment work available for mathematics?

Is there any assignment work available for mathematics?

Find the common difference of an ap, Find the common difference of an AP wh...

Find the common difference of an AP whose first term is 100 and sum of whose first 6 terms is 5 times the sum of next 6 terms. Ans:    a = 100 APQ a 1 + a 2 + ....... a 6

Find the equation to the pair of lines - coordinate geometry, 1. Find the n...

1. Find the number of zeroes of the polynomial y = f(x) whose graph is given in figure. 2 Find the circumcentre of the triangle whose vertices are (-2, -3), (-1, 0) and (7,-6).

I-phones in one year, Assume company A expects to enhance unit sales of i-p...

Assume company A expects to enhance unit sales of i-phone by 15% per year for the next 5 years. If you presently sell 3 million i-phones in one year, how many phones do you expect

Fermats theorem, Fermat's Theorem  If f(x) has a relative extrema at x...

Fermat's Theorem  If f(x) has a relative extrema at x = c and f′(c) exists then x = c is a critical point of f(x). Actually, this will be a critical point that f′(c) =0.

Fraction word problem, castor brought 6 3/4 carat cakes to share with 26 st...

castor brought 6 3/4 carat cakes to share with 26 students. did castor bring enough for each student to have 1/4 of cake?

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