Question: 5. Pi Approximations Name: Exercise 9 5.java Earlier in the course, we saw a formula for approximating r ly 2i -1 We wrote out the

 5. Pi Approximations Name: Exercise 9 5.java Earlier in the course,

5. Pi Approximations Name: Exercise 9 5.java Earlier in the course, we saw a formula for approximating r ly 2i -1 We wrote out the first few fractions by hand to get an estimate. But, now that we know loops we can use loops to calculate as many of the fractions as we want. Write a program that prints out the estimate using the formula above for the first 1,000,000 fractions (i.e., start counting at i = 1 and count through-1000000). Each time the counter variable is divisible by 100,000. print out what the current estimate is. Sample Run: Iterations 100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 Approximations 3.1415826535897198 3.1415876535897618 3.141589320256464 3.141590153589744 3.141590653589692 3.1415909869230147 3.141591225018261 3.1415914035897172 3.141591542478651 3.1415916535897743

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!