You are on page 1of 1

/*Daniel Camello CSC 270 5/19/20 Final*/

#include<cmath> // required in order to carry out calculations


#include<iostream>// required for all C++ programming

using namespace std; // mandatory

double fx(double x) // used to find the values which range from 0.1 to 1.4

double function; //assigned variable for the function

function = 100 * exp(3 * x) * cos(x / 2); //function we are integrating

return function; // returns the value of the function

int main()

double x; // variable x, so we're integrating with respect to x.

for (x = 0.1;x <= 1.5;x = x + 0.1) //loop in main function assigns value from
0.1 to 1.4 and prints the result.

cout << "\tthe value for\t" << x << "\twill be\t" << fx(x); //prints
out the values of the integral from 0.1<=x<=1.4

cout << endl;

return 0;

}
/*
the value for 0.1 will be 134.817
the value for 0.2 will be 181.302
the value for 0.3 will be 243.198
the value for 0.4 will be 325.394
the value for 0.5 will be 434.236
the value for 0.6 will be 577.945
the value for 0.7 will be 767.108
the value for 0.8 will be 1015.3
the value for 0.9 will be 1339.84
the value for 1 will be 1762.67
the value for 1.1 will be 2311.42
the value for 1.2 will be 3020.58
the value for 1.3 will be 3932.85
the value for 1.4 will be 5100.45
*/

You might also like