May 26, 2016

Homework Help: C++

Posted by maria PLEASE HELP on Friday, March 9, 2012 at 4:22pm.

Write a MAIN function and a FUNCTION to compute the sum of the below series.

((-1)^(n+1)*n!)/(n*n) (from n=1 to infinity)

Within the MAIN function:
. Read a variable EPSILON of type DOUBLE (desired accuracy) from
the standard input.
EPSILON is an extremely small positive number which can be anything
between 1E-06 (10^(-6)) and 1E-12 (10^(-12)).
. EPSILON value will be passed to the FUNCTION as an argument.
Within the FUNCTION:
. In a do-while loop:
. Continue adding up the terms until |Sn+1 - Sn| < EPSILON.
. Sn is the sum of the first n-terms.
. Sn+1 is the sum of the first (n+1)-terms.
When the desired accuracy EPSILON is reached print the SUM and the number
of TERMS added to the sum.

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions