Hey everyone, I have this question for my C++ homework. Write a program that com
ID: 3611754 • Letter: H
Question
Hey everyone, I have this question for my C++ homework.Write a program that computes the value of e^x by using the formulae^x = 1 + ((x^1)/1!) + ((x^2)/2!) + ((x^3)/3!) ...Prompt the user for the desired accuracy of e, i.e. the number of terms in the summationand the power of "e".Use 10 digits of precision to display the result.Expected Sample Output:Enter the exponent of "e" : 7Desired Accuracy (number of terms in the series) : 13e^7 with 13 terms = 1067.0243116203I really got no ideahow to do it because its not working at all. Below is my workdone. #include<iostream> #include<iomanip> #include<cmath> using namespacestd; intmain() { doublex,n; float e,factorial; cout<<"Enter theexponent: "; cin>>x; cout<<"Desiredterms of accuracy: "; cin>>n; for ( double i = 0 ; i< x ; i++) { factorial =factorial*i; e=1 + ((pow(x,n)) /factorial); } cout << " e^TERMS = " << E << endl; cout <<endl; system("PAUSE"); return 0; }
PLEASE HELP ME!!! IWIL RATE AS A LIFE SAVER FOR SURE!!! I have this question for my C++ homework.
Write a program that computes the value of e^x by using the formulae^x = 1 + ((x^1)/1!) + ((x^2)/2!) + ((x^3)/3!) ...Prompt the user for the desired accuracy of e, i.e. the number of terms in the summationand the power of "e".Use 10 digits of precision to display the result.Expected Sample Output:Enter the exponent of "e" : 7Desired Accuracy (number of terms in the series) : 13e^7 with 13 terms = 1067.0243116203I really got no ideahow to do it because its not working at all. Below is my workdone. #include<iostream> #include<iomanip> #include<cmath> using namespacestd; intmain() { doublex,n; float e,factorial; cout<<"Enter theexponent: "; cin>>x; cout<<"Desiredterms of accuracy: "; cin>>n; for ( double i = 0 ; i< x ; i++) { factorial =factorial*i; e=1 + ((pow(x,n)) /factorial); } cout << " e^TERMS = " << E << endl; cout <<endl; system("PAUSE"); return 0; }
PLEASE HELP ME!!! IWIL RATE AS A LIFE SAVER FOR SURE!!! I really got no ideahow to do it because its not working at all. Below is my workdone. #include<iostream> #include<iomanip> #include<cmath> using namespacestd; intmain() { doublex,n; float e,factorial; cout<<"Enter theexponent: "; cin>>x; cout<<"Desiredterms of accuracy: "; cin>>n; for ( double i = 0 ; i< x ; i++) { factorial =factorial*i; e=1 + ((pow(x,n)) /factorial); } cout << " e^TERMS = " << E << endl; cout <<endl; system("PAUSE"); return 0; }
PLEASE HELP ME!!! IWIL RATE AS A LIFE SAVER FOR SURE!!! #include<iostream> #include<iomanip> #include<cmath> using namespacestd; intmain() { doublex,n; float e,factorial; cout<<"Enter theexponent: "; cin>>x; cout<<"Desiredterms of accuracy: "; cin>>n; for ( double i = 0 ; i< x ; i++) { factorial =factorial*i; e=1 + ((pow(x,n)) /factorial); } cout << " e^TERMS = " << E << endl; cout <<endl; system("PAUSE"); return 0; }
PLEASE HELP ME!!! IWIL RATE AS A LIFE SAVER FOR SURE!!!
Explanation / Answer
never mind, i got it!