Skip to main content

Problem Solving Using Computer

Before writing a computer program, we must be clear about the processing steps to be performed by the computer. Hence, in order to ensure that the program/instructions are appropriate for the problem and are in the correct sequence, program must be planned before they are written. The problem solving contains a number of steps which are as below.

   Steps in problem solving by Computer


1)      Problem Analysis:
                Before solving a problem, it should be analyzed well. It is impossible to solve a problem by using computer without clear understanding & identification of the problem. Thus, problem analysis contains different activities like determining input/output, software and hardware requirement, time constraints, different types of users, accuracy etc. 

2)      Algorithm Development:
                Algorithm is step by step description of the method to solve a problem. In other words, it can be defined as a sequence of instructions designed in such a way that if the instructions are executed in the specified sequence, the desired result is obtained.
 Example: write an algorithm to solve the problem which tests a number for even or odd.

Step1: Start
Step2: Read a number.
Step3: Divide the number by 2 and check the remainder.
Step4: If the remainder in step 3 is zero,
              Display the number as even otherwise as odd.
Step5: Stop.

3)      Flowchart:
Flowchart is the graphical representation of the algorithm using standard symbols. In other words, flowchart is a pictorial representation an algorithm that uses boxes of different shapes to denote different types of instruction. The actual instructions are written within these boxes using clear statement. The boxes are connected by solid lines having arrow marks to indicate the flow of operation.
      Flowchart  Symbols 
  
Example of flow chart:
       Draw flowchart to solve the problem which tests the number for even or odd.      
             

4)      Coding:
             This is the process of transforming the program logic design into a computer language format. This stage translates the program design into computer instructions. These instructions are the actual program or software product. It can be said that coding is the act of transforming operations in each box of the flowchart in terms of the statement of the programming.

5)      Compilation and Execution:
                      The process of changing high level language into machine level language is known as compilation. It is done by a compiler. Once the compilation is completed then the program is linked, loaded and finally executed. The original high level language is called the source program and the resulting machine language program is called object program.

6)      Debugging & Testing:
              Debugging is the discovery and correction of programming errors. Even after taking full care in program design, some errors may remain in the program because the designer might have never thought about a particular case. These errors are detected only when we start executing the program in a computer. Such types of program errors are called BUGS and process of removing these BUGS is knows as debugging.
                Testing is the validation of the program. Testing ensures that program performs correctly the required tasks. The program testing and debugging are closely related.

7)      Program Documentation:

               Documentation of program helps to those who use, maintain and extend the program in future. Properly documented program is useful and efficient in debugging, testing, maintenance and redesign process. A properly documented program can easily be used again when needed and an undocumented program usually requires much extra work. Among the techniques commonly found in documentation are flowcharts, comments, memory maps, and parameter & definition list.

Comments

Popular posts from this blog

What is manipulator in C++?

Answer: Manipulators are special functions that can be included in the I/O statement to alter the format parameters of a stream. Table-2 shows some important manipulator functions that are frequently used. To access these manipulators, the file < iomanip.h > should be included in program.                               Table-2               Manipulators                                                    Equivalent ios function               set...

Network Topology

A network topology is the arrangement of the computers cable and other components on a network. The major goal of network topology is to find out the most economical and efficient way to connect all the users to the network resources while providing adequate capacity to handle users demand, maintain system reliability and decrease the delay.    Topology is the map of physical network. The type of topology we use defect the type and capabilities network hardware’s its management and possibilities for future expansion. There are many types of network topology, some of these are:   Bus Topology Star Topology Mesh Topology   Ring Topology Tree Topology

What is Servlet in Java?

A servlet is a small program that executes on a server. Just as applets dynamically extend the functionality of a web browser, servlets dynamically extend the functionality of a web server. It is helpful to understand that as useful as applets can be, they are just one half of the client/server equation. Not long after the initial release of Java, it became obvious that Java would also be useful on the server side. The result was the servlet. Thus, with the advent of the servlet, Java spanned both sides of the client/server connection.