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

Math, the size of my sitting room is 7metres by 6metres . i bought a rug fo...

the size of my sitting room is 7metres by 6metres . i bought a rug for covering the centre of its floor. one metre of the floor around the edge of the room is not to be covered by

Find the cost price of the toy, A dealer sells a toy for Rs.24 and gains as...

A dealer sells a toy for Rs.24 and gains as much percent as the cost price of the toy. Find the cost price of the toy. Ans:    Let the C.P be x ∴Gain = x % ⇒ Gain = x

Augmented matrix, Consider the following system of linear equations. X 1...

Consider the following system of linear equations. X 1 +x 3 +x 4 = 2 X 1 +x 2 +x 3 = 6 X 2 +x 3 +x 4 = 3 X 1 +x 2 +x 4 = 0  (a) Write out the augmented matrix fo

Find the circumference of a circle, Find the circumference of a circle whos...

Find the circumference of a circle whose area is 16 times the area of the circle with diameter 7cm            (Ans: 88cm) Ans:     Π R 2 = 16 Π  r 2 R 2 = 16 r 2

Acid solution, A 90% acid solution is mixed with a 97% acid solution to obt...

A 90% acid solution is mixed with a 97% acid solution to obtain 21 litres of a 95% solution. Findout the quantity of every solutions to get the resultant mixture.

Explain why f must be a di?erentiable function, Let f : R 3 → R be de?ned ...

Let f : R 3 → R be de?ned by:                                        f(x, y, z) = xy 2 + x 3 z 4 + y 5 z 6 a) Compute ~ ∇f(x, y, z) , and evaluate ~ ∇f(2, 1, 1) . b) Brie?y

Complex number, a ,b,c are complex numbers such that a/1-b=b/1-c=c-1-a=k.fi...

a ,b,c are complex numbers such that a/1-b=b/1-c=c-1-a=k.find the value of k

Formula to know the area of fan will wrap, Aaron is installing a ceiling fa...

Aaron is installing a ceiling fan in his bedroom. Once the fan is in motion, he requires to know the area the fan will wrap. What formula will he use? The area of a circle is π

How to simplifying square roots, How to Simplifying Square Roots ? To ...

How to Simplifying Square Roots ? To simplify square roots, 1. Factor the radicand into primes. 2. Circle each pair of like numbers. 3. For each pair of like numbers, place

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