Topic Content:
- Problem-Solving Skills With Computers
- Computer Problem-Solving Phases
- analysis, algorithm, coding, debugging, documentation, etc
- Summary
What is Problem Solving in Computer Programming?
Problem-solving is the process of identifying a problem, developing an algorithm for the identified problem and finally implementing the algorithm to develop a computer program.
A computer processes data by obeying a sequence of instructions called programs. A computer does not assist people in organizing their thoughts. You must have your solution procedure in hand, and the computer merely manipulates data according to your prescription.
If your solution is wrong, your computer output will be wrong, “Garbage In Garbage Out” GIGO. The solution procedure required by the computer is called an Algorithm.
Computer Problem-Solving Phases:
To solve problems with computers, we must go through the following steps:
1. Define the Problem:
This means defining the parameters within which the problem must be solved. Programmers must understand the problem and what it entails.
2. Problem Analysis:
This involves decomposing the overall problem into smaller parts to identify possible inputs, processes and outputs associated with the problem.
3. Design the Algorithm:
Before writing a program code for a given problem, It is essential to devise a solution. The solution is represented in natural language and is called an algorithm. For
a given problem, more than one algorithm is possible and we have to select the most suitable solution. The flowchart is a diagrammatical representation of the algorithm.
4. Programming/Coding:
This means implementing that method of solution using a programming language. After finalising the algorithm, we need to convert the algorithm into a format which can be understood by the computer to generate the desired solution.
Different high-level programming languages can be used for writing a program. e.g. Python, C++, BASIC, VBASIC, FORTRAN, Pascal, COBOL and so on.
5. Testing and Debugging:
Debugging is the process of finding and fixing errors or bugs in the source code of any software. When software does not work as expected, computer programmers study and test the code to determine why any errors occur.
The errors or defects found in the testing phases are debugged or rectified and the program is again tested. This continues till all the errors are removed from the program.
6. Program Documentation:
This involves writing a detailed description of the program and some specific facts pertaining to the usage and maintenance of the program.
Documentation consists two types of documentation, they are:
- Programmer’s Documentation
- User’s Documentation
Programmer’s documentation contains technical details and is used to update and maintain the program. User documentation is required for the end user who installs and uses the program. It consists of instructions for the installation of the program and user manual.
Summary:
In defining the problem, one must have a clear understanding of the problem. Once you can state the problem accurately, the direction of the solution becomes clearer.
For example, the hydra-headed traffic situation in Lagos. Understand the causes of the traffic situation and the places they occur. Then, break the problems into simpler parts, so that the solution of one sub-problem, followed by the solution of the next sub-problem, will provide a solution to the original problem.
Then, review your solution to ensure that it is complete and correct. The review should be done at every step/stage in the solution.
Of all the skills required to solve a problem using a computer, the ability to develop an Algorithm solution is the most important.