Steps to solve the problem

Steps to solve the problem

Published by: Nuru

Published date: 21 Jun 2021

Steps to solve the problem Photo

Steps to solve the problem

The steps to solve the problem with a Computer are definite, analysis, program design, coding, compile & execution, and debugging and testing.

Following are steps to solve the problem with the computer
1. Problem Definition
2. Problem Analysis
3. Program Design
4. Coding
5. Compilation and Execution
6. Debugging and Testing
7. Documentation

 

Problem Definition

1. A problem must be defined first. it helps in understanding the problem to the user and so he can proceed into further steps.
2. A clearly defined problem is already half the solution. So defining a problem is the most important key to solve any problem
3. Computer programming requires us to define the problem first before we even try to create a solution.
4. Based on the clear definition, one can proceed to problem analysis, design, and coding to writing the program to solve any problem.

 

Problem analysis

Problem analysis falls under the problem solving with the computer. analyzing a problem requires to meet the following criteria:
1. defining the problem- it is necessary to understand the problem to analyze a problem.

2. Input(s) to the problem-

we should find out how many inputs are required to solve the problem (eg- 1, 2, 3) their form (eg- int, char, float) and the input media to be used (eg-keyboard, mouse, camera).

3. Output(s) expected from the problem-
there should be a certain expectation of output from the problem like their form (eg- int, char, float) and the output media to be used (eg- monitor, speaker)
4. Special constraints or conditions (if any exist) should be noted

 

Program Design

This process involves in preparing the algorithms to the problem.
• Algorithm: An algorithm is a clear and unambiguous specification of the steps needed to solve a problem.
• Algorithm may be expressed as in either form,
1. Human language (e.g. English)
2. Pseudocode
3. Graphical Representation (Flow-Chart)

 

Coding

• Coding is the real job of a programmer.
• The algorithm to solve a problem which is described by pseudo-code or flow chart is converted into actual programming language code.
• The code written by the programmer by using any programming language like C is called the source code or source program.

 

Compilation and execution

• The source code written in any programming language is not directly executed by the computer.
• It should be translated into the machine-readable format i.e. actual machine language. The process of translation of source code into the target code is called the compilation.
• Each programming language has its own compiler program that translates the source code into its target code.
• The converted program in actual machine language is then executed by the computer which is known as program execution.

 

Debugging and Testing

• A written program may have errors, some errors can be detected by the language compilers, and some errors can not be identified by the compiler and occurred during the program execution.
• Common types of errors are:
– Syntax Errors: Identified by the compiler at the program compilation time, easily detected and corrected.
– Logical Errors: Not identified by the compiler at compile-time and identified at the execution time. e.g., misuse of operators. Detected during program execution
– Linker Errors: Errors detected while linking the compiled code with necessary libraries. Detected by Linker.
– Runtime Errors: Detected during program executions. These are basically logical errors and also the errors related to memory allocations.
• Testing is the process of checking the program for its correct functionality by executing the program with some input data set and observing the output of the program.
• Testing may be:
– Black Box Testing: Just give input test data and view the output which is correct or not as expected(user-level testing)
– White Box Testing: Detail debugging of code for testing the correctness of the program(Programar level testing)

 

Documentation

Documentation is the task of keeping all the references to the related program for future references.
• From the start of the problem solving to the end of the implementation of the program, all the tasks should be documented i.e. kept for future references.
• Documentation is also an important part of problem-solving or program development.