In Euclidean plane geometry, π is defined as the ratio of a circle's circumference to its diameter. While the value of π has been computed to billions of digits, practical science and engineering will rarely require more than 10 decimal places. π can be empirically measured by drawing a large circle, then measuring its diameter and circumference, since the circumference of a circle is always π times its diameter. π can also be calculated using purely mathematical methods. Most formulae used for calculating the value of π have desirable mathematical properties, but are difficult to understand without a background in trigonometry and calculus; however, some are quite simple, such as these forms of the Gregory-Leibniz series. (see below)
Create a program that will allow the user to enter select or enter a number. The computer will then calculate the value of PI using the above formula. It will use the above series in a loop and will iterate though it the number of times that the user has just chosen. For example if the user chooses the number of iterations at 1, then the value of PI will be 4. If user enters 5 it will be ~ 3.339. When the user starts the program, the value set to 1 and will count up as the program goes through the iterations.
If you are not sure on any part of the problem, just ask me and I will give you additional information.
This is a 2 part assignment. Part A is due the first week and then part B is due the second.
Part A:
Test Cases:
at thorough set of test cases done by some other method than your (or some else's) program covering valid inputs and edge cases that may cause an error for the program.
Part B:
Accept this github classroom assignment
Program should not have any prompt at all, just accept an input when run
Program should not have any output other than the answer or an error message
Program should run only once then exit (not prompt to try again etc.)
Valid inputs will be autograded and you can see them right away on committing in GitHub.
You will need to use a loop!
I can get a bonus? Yes you can!
If you complete just the above part of the assignment in Python, you will be marked out of 3+. You will be marked out of 4+ if you do the programming in PHP as well.