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

A graph with a positive slope, A graph with a positive slope shows that the...

A graph with a positive slope shows that the variables depicted on the axes goes in the similar directions.

What is the smallest possible number 3, What is the smallest possible numbe...

What is the smallest possible number in which can be created along with four decimal places using the numbers 3, 5, 6, and 8? Place the smallest number in the largest place val

Describe about parallel and perpendicular lines, Describe about Parallel an...

Describe about Parallel and Perpendicular Lines ? Parallel Lines : Parallel lines are coplanar lines (lines that lie in the same plane) that never intersect. The bl

Simple harmonic motion, prove that the composition of two simple harmonic o...

prove that the composition of two simple harmonic of the same period and in the same straight line is also a simple harmonic motion of the same period.

Mechanical vibrations, While we first looked at mechanical vibrations we lo...

While we first looked at mechanical vibrations we looked at a particular mass hanging on a spring with the possibility of both a damper or/and external force acting upon the mass.

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