This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Iteration CSc 1253: Project # 3 Approximating e Using a Power Series Out: 9/21 Due: 10/10 by 11:50 PM Learning Objectives Using Iteration More on Writing Interactive Programs Definition 1. The number e is irrational; that is, it cannot be expressed as a ratio of integers. Furthermore, it is transcendental; it is not a root of any nonzero polynomial with rational coefficients. The numerical value of e truncated to 20 decimal places is 2.71828182845904523536. The power series expansion of the function f ( x ) = e x is given by the expres sion: e x = summationdisplay i =0 x i i ! = 1 + x + x 2 2! + x 3 3! + x 4 4! + Approximating e . 1 using the first five terms of this power series gives, e . 1 = 1 + 0 . 1 + . 01 2 + . 001 6 + . 0001 24 = 1 . 10517 The e Approximation Program Write a program consisting of only the main function, called e approximator.cpp . When your program begins, the user is prompted to enter a number x rep resenting the power to which e is to be raised and a positive integer n repre senting the number of terms to be used in the approximation. Your program should then compute the power series approximation of...
View
Full
Document
This note was uploaded on 06/20/2011 for the course CSC 1253 taught by Professor Staff during the Fall '08 term at LSU.
 Fall '08
 Staff

Click to edit the document details