Problem Solving Using Computer

1. Problem analysis

Process: 

  • Identifying the objective
  • Note the input, processing and output requirements
  • Decomposition of whole parts in smaller parts
  • Applying the external knowledge to solve the respective problem

 Advantages:

  • It leads you to the solution of the program
  • It mainly helps for the program documentation.

2. Algorithm Development

Features: 

  • Sequence
  • Decisions
  • Repetition

Characteristics:

  • Input specified
  • Output specified
  • Definiteness    :    Each step must be clear, well-defined and precise
  • Effectiveness
  • Finiteness    :    Must terminate after finite number of steps
  • Independent   :    Not for only one language

Example: 

Step 1 :  Stat
Step 2 : Read three numbers A,B & C
Step 3 : If A>B, then go to step 6
Step 4 : If B>C, then print B & go to 
step 8
Step 5 : print C is greatest & go to 
step 8
Step 6 : If A>C, then print A is greatest & go to step 8
Step 7 : Print C is greatest
Step 8 : end

3. Flowcharting

A flowchart is a graphical representation of the separate steps of a process in sequential order.

Advantages:

Communication
Effective Analysis
Proper Documentation
Efficient Coding
Helpful for program maintenance
Easy in debugging


4. Coding

  • It is the process of converting the logic design into a computer language format.
  • In other word Program coding is the process of transferring algorithm and flowchart works into computer program using the well defined syntaxes of programming languages like C, C++, Python, Java etc.
  • It is the major part of problem solving by a computer. But it is only about one third of total task.

Example of coding:

//program to find large number among 2
//user enters the input
// coded by EngT and SG Tech.
#include<stdio.h>
#define max(a,b) a>b?a:
main(){
int a,b,c;
printf("Enter two numbers: ");
scanf("%d %d",&a,&b);
c=max(a,b);
printf("The maximum = %d",c);
}


5. Compilation and Execution

  • The process of converting the source code into machine level language is called compilation. Which is performed by compiler software. It tests the syntax errors.
  • After completion of compilation process, the program is linked with other object programs needed for execution resulting the binary program, the process is known as execution.


6. Debugging and Testing

Identifying and correcting the program errors is called Debugging. The error is identified by the compiler during compilation and execution process. Those errors are also known as syntax errors.
After the successful execution of program, the executed file may not gives you the result you want, due to logical error while coding. which is also known as runtime error / semantic Errors. Identifying and correcting those error is called testing

7. Documentation

It is the systematic writing of activities from problem analysis to debugging and testing phases including operational information and presenting it as a report.

Types:

1. Technical Documentation (Documentation for programmers)
2. User Manual (Documentation for users)



Post a Comment

Previous Post Next Post