// // Filename: series.cpp // // Description: This program demonstrates the evaluation of several // mathematical series. These include the geometric series // and the series representation of the sine function. // // ENSC 104: Digital Computer Programming // // Section: 1 or 2 // // Date: xx/xx/97 // // Name: Dr. Walsh // #include #include const int NUM_TERMS = 30; main() { double sum=0.0; double x=0.0; int i; int n; // // Geometric Series: converges to 1/(1-x) where x < 1. // cout << "Enter x for geometric series: "; cin >> x; cout << "You entered x = " << x << endl; for( n=0; n> x; cout << "You entered x = " << x << endl; double factorial = 1; double term = 0.0; sum = x; for( n=3,i=1; n