Outline for May 11, 2009
Reading: §9.4–9.6
- Overview of bottom-up design
- Take existing pieces and combine them
- Keep building up until you have solved the problem
- Do the glue first, with the smaller parts being stubs
- Do the stubs
- Example: compute binomial coefficients
- Need to read user input (see
bc-1.py)
- Need to compute factorials (see
bc-2.py)
- Need to print polynomial with integer coefficients (see
bc-3.py)
- Combine (see
bc.py)
- Example: Monte Carlo method for approximating π
- Need to generate where dart toss winds up (see
mc-1.py)
- Need to determine if it is in unit circle (see
mc-2.py)
- Need to read user input (see
mc-3.py)
- Combine (see
mc.py)
- Other approaches
- Prototyping and spiral development