- Take a break learning commands to talk about general approaches
- Real computational tasks are complicated. To accomplish them you need to think before you code.
Problem decomposition steps (10 minutes)
Open the following images one per tab and cycle through:
- Understand the problem
- Restate the problem in your own words
- Determine the inputs and outputs
- Ask for clarification
- Break the problem down
- Write down the pieces, on paper or as comments in a file
- Break complicated pieces down until all pieces are small and manageable
- Code one small piece at a time
- Test it on it’s own
- Fix any problems before proceeding
Breaking down an exercise (15 minutes)
- This week we will be working on more complex exercises
- Show end result of first exercise
- Take time 5 minutes to read through one of the exercises
- Then we’ll try to break it down into pieces as a class
Start simple
- Experiment
- Write a simpler version
- Make sure it works
- Make sure you understand it
- Modify it to make it more complicated
- Repeat until finished