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

Passing arrays to functions in C programming

Like any other variables, we can also pass entire array to a function. An array name can be named as an argument for the prototype declaration and in function header. When we call the function no need to subscript or square brackets. When we pass array that pass as a call by reference because the array name is address for that array. /* Program to illustrate passing array to function */ #include<stdio.h> void display(int) ; /* function prototype */ main( ) { int num[5] = {100, 20, 40, 15, 33, i ; clrscr( ) ; printf (“\n The content of array is \n”) ; for (i=0; i<5; i++) display (num[i]) ; /*Pass array element fo fun */ getch{ } ; } void display(int n) { printf (“\t%d”, n ) ; } Output:     The content of array is 100      20       40       15 3 /* Program to read 10 numbers from keyboard to store these num into array and then c...

Explanation of Graphics in C programming

   The header file graphics.h should be included to use graphics related built in functions. Again, the variable gDriver is an integer variable that specifies graphics driver to be used. Device drivers are small programs which talk directly to the hardware. Graphics drivers are a subset of device drivers and are applicable only in the graphics mode. The initialization of this variable to DETECT is to set another variable gMode to the highest resolution available for the detected driver.  The value of this variable gDriver may be another than DETECT (e.g. 1 for CGA, 9 for VGA.). The variable gMode is an integer that specifies initial graphics mode.       The built in function initgraph() is for graphics initialization. The syntax for this is as   initgraph(&graphics_driver, &graphics_mode, path_to_driver);   path_to_driver specifies the directory path where initgraph() looks for graphics drivers ( .BGI files). Thi...

Software Development Life Cycle

Software Crisis In earlier days, same codes needed to be written time and again increasing the complexity and time required for development This resulted in software not being completed on time and the cost increased than expected Solution: Object Oriented Programming Software Evolution Investigation Feasibility Study Analysis Design Implementation Maintenance Investigation First step in preparation of the IS includes the preliminary study of proposed information system investigates the information needs of the users and determines the resource requirement, costs, benefits and feasibility of a proposed project 2. Feasibility Study feasibility study is an analysis of the practicality of an idea focuses on helping answer the essential question of “should we proceed with the proposed project idea?” The feasibility study is conducted in four different areas: 1. Organizational feasibility 2. Economic feasibility 3. Technical feasibility 4. Operation...