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

Total linear attenuation, Consider the task of identifying a 1 cm thick bre...

Consider the task of identifying a 1 cm thick breast cancer that is embedded inside a 4.2 cm thick fibroglandular breast as depicted in Fig. The cancerous tumor has a cross

Round 14.851 to the nearest tenth, Round 14.851 to the nearest tenth? T...

Round 14.851 to the nearest tenth? The tenths place is the ?rst number to the right of the decimal. Here the number 8 is in the tenths place. To decide whether to round up or

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

Logarithmic function:solve for x: 4 log x2, Solve for x: 4 log x = log (15 ...

Solve for x: 4 log x = log (15 x 2 + 16) Solution:              x 4 - 15 x 2 - 16 = 0                (x 2 + 1)(x 2 - 16) = 0                x = ± 4   But log x is

Geography, How do you find the maxima or minima on a parabolic graph?

How do you find the maxima or minima on a parabolic graph?

Decision tree analysis, DECISION TREE ANALYSIS The Finance Manager of ‘...

DECISION TREE ANALYSIS The Finance Manager of ‘Softy’ baby soap manufacturing company being successful in the first two years of the company’s operations is considering to set

Definition of random variables, Q. Definition of Random Variables? Ans...

Q. Definition of Random Variables? Ans. Up to this point, we have been looking at probabilities of different events. Basically, random variables assign numbers to element

Minimizes the sum of the two distance, The value of y that minimizes the su...

The value of y that minimizes the sum of the two distances from (3,5) to (1,y) and from (1,y) to (4,9) can be written as a/b where a and b are coprime positive integers. Find a+b.

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