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

Marketing, What are the Input and Output of Marketing

What are the Input and Output of Marketing

Area of a hyperbolic wedge, The unit circle will be parametrized by (cosw, ...

The unit circle will be parametrized by (cosw, sinw). Provide a point on it, the region cut out by circle, the x-axis, and the line from the origin to this point has covered area w

Simulation model, Thorwarth M., Arisha, A. and Harper P., (2009) Simulation...

Thorwarth M., Arisha, A. and Harper P., (2009) Simulation model to investigate flexible workload management for healthcare and servicescape environment, Proceedings of the 2009 Win

Cooking measurement question, Ask question what is half of 1 1/3 liquid mea...

Ask question what is half of 1 1/3 liquid measurements?

Discrete-time signals as energy or power signals, Classify the following di...

Classify the following discrete-time signals as energy or power signals. If the signal is of energy type, find its energy. Otherwise, find the average power of the signal. X 1

Combined mean and standard deviation, Combined Mean And Standard Deviation ...

Combined Mean And Standard Deviation Occasionally we may need to combine 2 or more samples say A and B. Therefore it is essential to identify the new mean and the new standard

Which of the following binomials could represent the length, The area of Mr...

The area of Mr. Smith's rectangular classroom is x 2 - 25. Which of the following binomials could represent the length and the width of the room? Since area of a rectangle is

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