Common Computer Science References
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 something and then using a loop, do some kind of calculation. In my example the user enters in the number of times that the computer will do the calculation below. The computer will then calculate the value of PI using the formula. It will use the formula in a loop and will iterate through 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.
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 JavaScript, you will be marked out of 3+. You will be marked out of 4+ if you do the programming in another language as well.