What is Problem Solving in Programming
What is Problem Solving in Programming
Computers are used to solve various problems in day-to-day life. Problem Solving is an
essential skill that helps to solve problems in programming. There are specific steps to be
carried out to solve problems in computer programming, and the success depends on how
correctly and precisely we define a problem. This involves designing, identifying and
implementing problems using certain steps to develop a compute
Before being ready to solve a problem, there are some steps and procedures to be followed to
find the solution. Let's have a look at them in this problem solving in programming article.
Coding
Every problem has a perfect solution; before we are ready to solve a problem, we must look
over the question and understand it. When we know the question, it is easy to find the
solution for it. If we are not ready with what we have to solve, then we end up with the
question and cannot find the answer as expected. By analysing it, we can figure out the
outputs and inputs to be carried out. Thus, when we analyse and are ready with the list, it is
easy and helps us find the solution easily.
It is required to decide a solution before writing a program. The procedure of representing the
solution in a natural language called an algorithm. We must design, develop and decide the
final approach after a number of trials and errors, before actually writing the final code on an
algorithm before we write the code. It captures and refines all the aspects of the desired
solution.
An algorithm can be presented in different ways; pseudo code, flowcharts, decision tables etc.
To give you an example of an algorithm, lets take an example of a program that adds two
numbers. An algorithm for such a program could be as follows:
1. Start
6. Print sum.
7. Stop.
4. Coding
Once we finalise the algorithm, we must convert the decided algorithm into a code or
program using a dedicated programming language that is understandable by the computer to
find a desired solution. In this stage, a wide variety of programming languages are used to
convert the algorithm into code.
Once you have your algorithm, its time for the real fun; coding. Start by handling small pieces
of your problem first and combine them to form a solution to the large piece.
For instance, for our addition algorithm above, you can start by tackling the step 2 (create
variables x, y, and sum). Next, ask the user to enter the numbers to add and so on.
The designed and developed program undergoes several rigorous tests based on various real-
time parameters and the program undergoes various levels of simulations. It must meet the
user's requirements, which have to respond with the required time. It should generate all
expected outputs to all the possible inputs. The program should also undergo bug fixing and
all possible exception handling. If it fails to show the possible results, it should be checked
for logical errors.
Industries follow some testing methods like system testing, component testing and acceptance
testing while developing complex applications. The errors identified while testing are
debugged or rectified and tested again until all errors are removed from the program.