Due: January 27, 2012 | Points: 100 |
For this homework, please put refinements for all your programs into one file called “refinements.txt” or “refinements.pdf”, and error journal entries for all your programs into one file called “errors.txt” or “errors.pdf”.
The first two problems use the following relationship:
What your program should show: Suppose the user wants to use 3456 terms. Then your program’s execution should look like this (what the computer prints is in typewriter font, what the user types is in italics style, and ↵ represents typing “enter” or “return”:
How many terms should be used to approximate pi? 3456↵Submit: Please turn in your program in the file “pi.py”.
After 3456 terms, approximate pi = 3.141303; error is 0.000289
What your program should show: There is no input. The output is to be like the last line of output for problem 1.
Submit: Please turn in your program in the file “pi2.py”.
What your program should show: Suppose the user wants to draw a hexagon (a 6-sided polygon). Then your program’s execution should look like this:
How many sides do you want on the polygon? 6↵and then the program draws the hexagon in a new window.
Submit: Please turn in your program in the file “turtlen.py”.
See the Extra Credit #2 assignment.
ECS 10, Basic Concepts of Computing Winter Quarter 2012 |