Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
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