Introduction to Problem Solving
Problem solving with computers
List the steps for solving a problem with a computer.
A computer cannot solve a problem on its own. We must give it precise, step-by-step instructions. Problem solving is the process of identifying a problem, developing an algorithm for it, and implementing the algorithm as a program. It follows clear steps:
- Analysing the problem: read it carefully, list its main parts, and decide what the inputs and the outputs will be. Remember GIGO: garbage in, garbage out. If the input is wrong, the output will be wrong too, however good the program.
- Developing an algorithm: write down the exact steps, like a well-written recipe. Start with a rough plan and refine it. Often there are several possible algorithms; choose the most suitable one.
- Coding: convert the algorithm into a high-level programming language, and document it (add notes explaining the code).
- Testing and debugging: check that the program gives the correct output for all kinds of input.
Two common kinds of error:
- A syntax error (breaking the rules of the language, like a spelling or punctuation mistake) stops the program from running at all, so it gives no output.
- A logical error lets the program run, but it gives the wrong output, because the steps themselves are wrong.
In industry, software goes through several levels of testing: unit testing (each part on its own), integration testing (parts working together), system testing (the whole program), and acceptance testing (by the user). Even after delivery, maintenance goes on: fixing problems that appear, and adding new features.
Practise this lesson
Questions that get harder as you improve, a Tutor that helps without giving the answer away, and progress you can see. Free for every learner.
No account, no email address. Opens the real product.