Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c programming: Q4 xyD GQ2: (Weekly Pay Calcula Dashboard C E ESPN The worldwid Homework-04-Spring-20 1 file://home/chronos/u-098f0a422b194aa432f0e5b77b6868e769e8f3ab/Downloads/Homework-04-Spring-2018.pdf ComingSoon.net M IMDb Movies, TV a O

in c programming: Q4

image text in transcribed

xyD GQ2: (Weekly Pay Calcula Dashboard C E ESPN The worldwid Homework-04-Spring-20 1 file://home/chronos/u-098f0a422b194aa432f0e5b77b6868e769e8f3ab/Downloads/Homework-04-Spring-2018.pdf ComingSoon.net M IMDb Movies, TV a O YouTubeMovies Movie Trail a Amazon.com Onlin WT Wells Fargo Perso R welcome to Face o CapitalOne Credit C You should output the following: (13) Q4: (Approximating ) (25 points) The value of can be approximated with the infinite series as follows 1 3 5 7 9 11 Write a program that determines how many terms in takes using the above infinite series to approximate to 3.14159. You can state the answer to this question in the word document you submit, if you obtain the answer through trial and error Bonus (5 points): Your program should stop itself when the precision is met and output the following: It took n terms to approximate pi to 3.14159. Hint: Think about a numerator and a denominator. You learned in a previous homework how to generate odd number sequences. Pay close attention to the sign of each term. Casting: You car eliminate all numbers beyond the 5th decimal position using casting, such as int a = (int)(3.14159265" 100000). Here a float is being multiplied by an integer, with the result being aat. The decimal point has been moved 5 places to the right. Use (int) to "cas that into an integer, truncating all the decimals of the new number, resulting in the new number 314159 12:00 )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe new developments in the design of pay structures. page 475

Answered: 1 week ago