Answered step by step
Verified Expert Solution
Question
1 Approved Answer
the series from the file created goes upto 123456789. please help been stuck on it from a day. Part II - PI Calculation Implementation (15
the series from the file created goes upto 123456789. please help been stuck on it from a day.
Part II - PI Calculation Implementation (15 pts) . If you watch the Discovery or Sci-Fi channel you will find dozens of alien conspiracy shows that reference Pi as something so advanced that it must be alien. The number is a mathematical constant, the ratio of a circle's circumference to its diameter, commonly approximated as 3.14159. So you could graph the value or calculate an approximate value using the series given below: Pi - 4. (1/1 - 1/3 + 1/5 - 1/7 + 1/9 . (alternating + -) (1) )Note: 1. Variable to store the value of Pi should be a double to allow many decimals. Notice that the numerator is always lor-1. So if we set the numerator at-1 (before the start of the loop) and inside the loop multiplied it by -1, then the first numerator will be 1, the next numerator will be -1, and so on. 2. The denominator goes from 1 to 3 to 5 to 7 to 9, etc. This is counting by 2s starting at one. 3. For loops are good when you know how many times it will go through the loop. So a for loop might be something like: for (long denom-1; denom Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started