The value of e^x can be computed as the power series e^x= Σn = 0∞ xn/ n!
where n! = 1 · 2 · 3 · ... · n.
prepare a program that computes e^x using this formula. Of course, you can't compute an infinite sum. Just keep adding values until an individual summand (term) is less than a certain threshold. At each step, you need to compute the new term and add it to the total. Update these terms as follows:
term = term * x / n;
Follow the approach of the preceding exercise, by implementing a class ExpApproximator. Its first guess should be 1.