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

Show that the ratio of the volume of the sphere, A sphere and a cube have e...

A sphere and a cube have equal surface areas. Show that the ratio of the volume of the sphere to that of the cube is √6 : √π. Ans:    S.A. of sphere = S.A of cube    4π r 2

Find the perimeter of the rectangle, Find the perimeter of the figure, wher...

Find the perimeter of the figure, where AED is a semi-circle and ABCD is a rectangle.    (Ans : 76cm) Ans:    Perimeter of the fig = 20 + 14 + 20 + length of the arc (AED

Circles, If the distances from origin of the centres of 3 circles x 2 +y 2 ...

If the distances from origin of the centres of 3 circles x 2 +y 2 +2alphaix= a 2 (i=1,2,3) are in G.P. , then length of the tangents drawn to them frm any point on the circles x2+

Application of statistics-quality control, Quality Control Normally th...

Quality Control Normally there is a quality control departments in every industry which is charged along with the responsibility of ensuring about the products made do meet th

Npv, how to calculate the npv

how to calculate the npv

Math, i have problems with math and my teacher said that i am still progres...

i have problems with math and my teacher said that i am still progressing in math

Pythagorean theorem, How do you find the perimeter of an irregular shape us...

How do you find the perimeter of an irregular shape using Pythagorean theorem?

Solve the algebraic equestions, Solve the following equestions i.2x-8=8 ...

Solve the following equestions i.2x-8=8 ii.3x+2/5=4 iii.8/3x-2=2 iv.0.6x-5=7

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

I want to learn mathematics, I was never really good at mathematics what is...

I was never really good at mathematics what is the best way? I am reading Math better explained but is there anything else I can do? I want to study advanced topics and get a good

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