Question 2: (3 marks) The value of a can be calculated using the infinite series: 4 = 4-5+5779 4 4 + 3 Write a function
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 2: (3 marks) The value of a can be calculated using the infinite series: 4 = 4-5+5779 4 4 + 3 Write a function
Question 2: (3 marks) The value of a can be calculated using the infinite series: 4 = 4-5+5779 4 4 + 3 Write a function float pi(int terms) that takes the precision as the number of series terms and return the estimated value of x based on those terms. Example: pi(1) should return 4 : only one term is used: 4. pi(2) should return 2.66; two terms where used: 4 - <insert your program here> <insert a screenshot of the output here when calling pi(1), pi(2), pi(10), pi(50), pi(100), pi(1000), pi(10000)>
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!