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

By the method of completion of squares solve equation, By the method of com...

By the method of completion of squares show that the equation 4x 2 +3x +5 = 0 has no real roots. Ans:    4 x 2 +3 x +5=0 ⇒  x 2 + 3/4 x + 5 = 0 ⇒   x 2 + 3/4 x +

Define markov process, Define Markov process. Markov process is one in...

Define Markov process. Markov process is one in which the future value is independent of the past values, given the current value

Scale Drawing, Model of 180 meter tall building using a scale of 1.5 centim...

Model of 180 meter tall building using a scale of 1.5 centimeters = 3.5 meters. How tall will the model be?

Product moment coefficient, Product Moment Coefficient This gives an i...

Product Moment Coefficient This gives an indication of the strength of the linear relationship among two variables. Note that this formula can be rearranged to have di

Stratified sampling, Stratified sampling In stratified sampling case t...

Stratified sampling In stratified sampling case the population is divided into groups in such a way that units in each group are as same as possible in a process called strati

Can you explain slope, Can you explain slope and Slope is measured as rise/...

Can you explain slope and Slope is measured as rise/run?

What is the square root of -i and argument of -i, What is the square root o...

What is the square root of -i and argument of -i Ans) argument of -i is 270 ad 1 is the square root of -i

What is equivalent of this temperature in degrees fahrenheit, The temperatu...

The temperature in Hillsville was 20° Celsius. What is the equivalent of this temperature in degrees Fahrenheit? This problem translates to the expression 3 {[2 - (-7 + 6)] + 4

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