Top-down design starts with the big picture. Describe the program in plain words or a diagram, then divide it into manageable blocks before writing detailed code. section 6.0 section 6.1
A practical top-down workflow looks like this:
- Plan the main algorithm with words and flowchart symbols. section 6.0 section 6.1
- Represent large activities as functions such as get_order(), print_order(), and save_order(). section 6.0 section 7.0
- Use simple placeholder functions to test the main algorithm before implementing real behavior. section 6.1 section 7.0
- Replace each placeholder with working details, correcting errors as they appear. section 7.0
A café order menu
A main menu repeatedly gets an order, displays it, asks for confirmation, saves confirmed orders, and returns to the next customer. The details of getting names, flavors, and toppings stay inside get_order() rather than cluttering the main algorithm. section 6.0 section 7.0
Use the flowchart figure to inspect how the large program blocks and decision paths fit together before examining their code. section 6.0

