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

Statistics, explain the characteristics of statistics

explain the characteristics of statistics

Probability transition matrices or brand switching, Define the Probability ...

Define the Probability Transition Matrices or Brand switching.

Linear programming problem, I have a linear programming problem that we are...

I have a linear programming problem that we are to work out in QM for Windows and I can''t figure out how to lay it out. Are you able to help me if I send you the problem?

Derive the marshalian demand functions, (a) Derive the Marshalian demand fu...

(a) Derive the Marshalian demand functions for the following utility function: u(x 1 ,x 2 ,x 3 ) = x 1 + δ ln(x 2 )       x 1 ≥ 0, x 2 ≥ 0 Does one need to consider the is

How much wrapping paper will needed, Barbara is packing a wedding gift that...

Barbara is packing a wedding gift that is contained within a rectangular box 20 by 18 by 4 in. How much wrapping paper will she require? a. 512 in 2 b. 1,440 in 2 c. 1,0

How many baseball cards does peter now have, Peter purchased 14 latest base...

Peter purchased 14 latest baseball cards for his collection. This increased the size of his collection through 35%. How many baseball cards does Peter now have? First, you must

Geometria, un prisma retto ha per base un rombo avente una diagonale lunga ...

un prisma retto ha per base un rombo avente una diagonale lunga 24cm. sapendo che la superficie laterale e quella totale misurano rispettivamente 2800cm e3568cm ,calcola la misura

Vb code, some basic vb codes withing excel to get things done quickly.

some basic vb codes withing excel to get things done quickly.

Application of interpolation and extrapolation, Application Interpolati...

Application Interpolation and extrapolation are widely used by businessmen, administrators, sociologists, economists and financial analysts. While interpolation hel

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