Answer to Question #74793 in C++ for Dillon Morris
You are required to write a function, sumSeries, which given x, n returns the sum of the series. Use #include <cmath> and the abs function. Do not use the pow function.
double sumSeries(double x, int n)
double sum = 0;
double nominator = 1;
for (int i = 1; i <= n; ++i)
nominator *= x;
double element = nominator/i;
sum += element;
if (std::abs(element) < 0.00001)
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!