Question: Programming Assignment 1 CSCI 251 - Spring 2018 Introduction Leonhard Euler was a Swiss mathematician, physicist, astronomer, logician and engineer who made important and influential

 Programming Assignment 1 CSCI 251 - Spring 2018 Introduction Leonhard Eulerwas a Swiss mathematician, physicist, astronomer, logician and engineer who made important

Programming Assignment 1 CSCI 251 - Spring 2018 Introduction Leonhard Euler was a Swiss mathematician, physicist, astronomer, logician and engineer who made important and influential discoveries in many branches of mathematics. He was one of the most eminent mathematicians of the 18th century and is held to be one of the greatest in history. His contributions are in almost all areas of mathematics, such as algebra, geometry, trigonometry, calculus, and number theory, as well as continuum physics, lunar theory and other areas of physics. Euler is the only mathematician to have two numbers named after him: the important Euler's number in calculus, e, approximately equal to 2.71828, and the Euler-Mascheroni constant (gamma) sometimes referred to as just "Euler's constant", approximately equal to 0.57721 For program 1, you will write a program to calculate what are known as Euler Numbers (NOT to be confused with Euler's number, e)-the code for this program will be used later in the semester for additional programming assignments. The secant Euler numbers are a sequence En of integers defined by the Taylor series expansion En n! cosht et+e n=0 where cosh t is the hyperbolic cosine. The Euler numbers are related to a special value of the Euler polynomials, namely: En= 2nEne) where E,--61 1385 Es -50521 Because the Euler numbers are an asymptotic series, their approximate values can be calculated as follows: n (4 n En = ~ (-1)n 8in( e) (First Method) A more efficient asymptotic series is given by the following 2n n(411 /480 n2 + 9 ( e (480122-1 (Second Method) Write code that prompts for n (the Euler number to calculate), and determine En using both the first method and the second method. Output the % difference between the two methods (absolute value of (first method En second method En) divided by the first method En times 100) Input n, the Euler number to calculate (integer) Output Euler number (integer) Euler number using the First Method (double) Euler number using the Second Method (double) % Difference between first method and second method (double)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!