Outline for April 22, 2014
Reading
:
none
Due
: Homework #2, May 2, 2014
Program: Fibonacci numbers [
fib.py
]
Calculating π using a Monte Carlo method
How you do it
random
module
Building program in modules, including testing routines
First step: computing co-ordinates of dart toss [
mc1.py
]
Second step: see if a point falls within the unit circle [
mc2.py
]
Third step: read in a positive integer, with error checking [
mc3.py
]
Fourth step: out it all together and print the results [
mc4.py
]
Fifth step: plot the points [
mc5.py
]
You can also obtain a PDF version of this.
Version of April 21, 2014 at 9:01AM