Assigned Date: Friday, Sep. 7, 2007
Due Dates: Monday, Sep. 17, 2007
Due Time: 11:55pm
Last modified on September 13, 2007, at 10:40 PM (see updates)
piApproximator.py that approximates the value of π by summing the terms of this series: 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + ... The program should prompt the user for n, the number of terms to sum, and then output the sum of the first n terms of this series.
Have your program subtract the approximation from the value of
math.pi to see how accurate it is.
(This is exercise 15 on p. 74 of the text.)
Use ideas from chaosTurtle.py to visualize how close your approximation is. (Hint: Draw two lines, one with length equal to π*100, and the other with length that slowly increases as the approximation is getting better.
Do this in a separate program,
piApproximator.py file as an attachment.
Email subject should be "Assignment #1".
My email address is email@example.com.
(If you do the bonus, submit both programs in the same email, as attachments.)
The following policies are in effect for this assignment:
All identifiers should be meaningful.
Include your design (pseudocode) as comments in your program.
The following comments should appear in your program as the first lines in the file. Items in angle brackets are either to be removed or replaced with what is specified within the brackets: