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

Find out the length of hamiltonian path, Find out the length of Hamiltonian...

Find out the length of Hamiltonian Path in a connected graph of n vertices. Ans: The length of Hamiltonian Path in a connected graph of n vertices is n-1.

Why learn mathematics, Here we have considered the following points. 1. ...

Here we have considered the following points. 1. Mathematics is omnipresent, powerful and beautiful. 2. Mathematics is useful in all spheres of life. 3. Mathematics can al

..compound intrest, tell me about the software of compound intrest?

tell me about the software of compound intrest?

What is the total balance of an account after 18 months, A certain bank pay...

A certain bank pays 3.4% interest per year for a certificate of deposit, or CD. What is the total balance of an account after 18 months along with an initial deposit of $1,250?

Twelve coworkers go out how many slices will each person get, Twelve cowork...

Twelve coworkers go out for lunch together and sequence three pizzas. Each pizza is cut within eight slices. If each person gets the similar number of slices, how many slices will

Use the power function to find derivative, Given, y = f(x) = 2 x 3 - 3x 2 ...

Given, y = f(x) = 2 x 3 - 3x 2 + 4x +5 a)  Use the Power function to find derivative of the function. b)  Find the value of the derivative at x = 4.

How many white marbles does the jar contain? , A jar contains 54 marbles e...

A jar contains 54 marbles each of which is blue , green or white. The probability of selecting a blue marble at random from the jar is 1/3  and the probability of selecting a green

Congruence, Write a proff given angle MJL congruent with angle KJL

Write a proff given angle MJL congruent with angle KJL

Calculate the average, During 2008 the average number of beds required per ...

During 2008 the average number of beds required per day at St Hallam's hospital was 1800.  During the first 50 days of 2008 the average daily requirement for beds was 1830, with a

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