Thoughts on basic problem solving pattern
Problem solving
- Typical steps to solve a problem
- Mindfully read the problem specification
- Seek clarity for ambiguity or possible mis-specification
- Determine the required values for solving the problem
- Develop an algorithm for the problem
- Implement the algorithm as a program
- Verify program faithfully solves the problem (e.g., testing)
- Repeat above steps as necessary
Interactivity
- An interactive program gets input and produces output. It provides a solution for a collection of problem instances.
- A non-interactive program solves a single problem instance.
- Typical interactive program steps
- Problem setup
- Import libraries to assist with problem solving
- Define constants that characterize the problem
- Get input
- Convert input into problem instance to be solved
- Compute solution — i.e, problem solve
- Report result
© 2019 Jim Cohoon | Resources from previous semesters are available. |