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

Negative number, what should added to the sum of (-26) and 31 to m...

what should added to the sum of (-26) and 31 to make it equal to the sum of (-35) and (-11) question #Minimum 100 words accepted#

Describe segments, Describe Segments, Rays, Angles, and Triangles We now...

Describe Segments, Rays, Angles, and Triangles We now define some more basic geometric figures. 1. Segments Definition A segment is the set of two given points and all the

How to converting fractions to decimals explain with example, How to Conver...

How to Converting Fractions to Decimals explain with example? To convert fractions to decimals, divide the numerator by the denominator. The quotient is the decimal. Ex

Differentiate the equation x = x (t ) and y = y (t ) , Suppose that x = x (...

Suppose that x = x (t ) and y = y (t ) and differentiate the following equation with respect to t. Solution                                         x 3 y 6 + e 1- x - cos (5

How many years will it take him to pay off the loan, Joe took out a car loa...

Joe took out a car loan for $12,000. He paid $4,800 in interest at a rate of 8% per year. How many years will it take him to pay off the loan? Using the easy interest formula I

How many people are usual to vote for mr salva on survey, The Daily News re...

The Daily News reported that 54% of people surveyed said in which they would vote for Larry Salva for mayor. Based on the survey results, if 23,500 people vote in the election, how

Inequalities, seven more than a number is less than or equal to -18

seven more than a number is less than or equal to -18

Laws of set algebra, Laws of Set Algebra From the given Venn diagram w...

Laws of Set Algebra From the given Venn diagram where T is the universal set and A its subset that we can deduce a number of laws as: i. A υ Ø = A ii. A υ T = T

Proof of the derivative of a constant, Proof of the Derivative of a Constan...

Proof of the Derivative of a Constant : d(c)/dx = 0 It is very easy to prove by using the definition of the derivative therefore define, f(x) = c and the utilize the definiti

Complex numbers, How t determine locus of a goven point

How t determine locus of a goven point

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