ECE-1305-002 Spring 2015 Programming PROJECT 4 Due date: 03/12/2015 Thursday (11
ID: 644219 • Letter: E
Question
ECE-1305-002 Spring 2015 Programming PROJECT 4 Due date: 03/12/2015 Thursday (11:59 P.M.) Write (also compile and execute) a complete C++ program that finds numerically the values of the series f and g and the number of terms in the series (Nf and Ng). f and g are defined from the infinite Series: 2k +1 and k-0 where k! is the factorial of k Your program MUST perform the following tasks: Task Description Task Prompt the user to enter a positive integer number n, defined the range 2S n X15, and then i VERIFY if the number entered lies within the specifications. Your program MUST allow the user to reenter the number without the need to rerun the program. Calculate and display on the screen the THREE sequences below (fi, and gi) and their respective NUMBER OF TERMS Nf or Ng N +12. 11.0 g (1.0, Ng) with an accuracy better than 10 n that is, the absolute difference between two consecutive sums with Nr and Nr+1 (or Ng and Ng+1) must be less than 10", where n is the value inputted by the user g (1.0, NE)Explanation / Answer
#include #include #include #include using namespace std; double my_sin(double); double my_exp(double); int main() { ofstream output; double lowerbound, upperbound, increment; char response; output.open("output.txt"); //if output.txt does not exist it is created //if it does exist the existing data is wiped out and a new set written to it do { output increment; outputRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.