Problem solving using computer

  A) Problem solving using computers:-

  • Number of problem in our daily life.
  • Suppose we have to calculate simple Interest
  • Suppose we have to prepare a mark sheet.
  • A computer is a DUMB machine.
  • A computer  cannot do anything alone without software i.e. Program 
  • A Software is  set of set programs written to solve a particular problem.
  • Software is a set of instructions on the basis of of which computer gives output/result.
  • If the instructions are not correct, the computer gives wrong result.

Never Ever Forget:-
  • Just writing code  is not sufficient to solve a problem.

  • Program must be planned before coding in any computer language available

  • There are many activities to be done before and after writing code.


Stage while solving a problem using Computer:-
  1. Problem Analysis

  2. Algorithm Development

  3. Flowcharting

  4. Coding 

  5. Compilation and Execution 

  6. Debugging and Testing 

  7. Documentation 

1)Problem Analysis:-
  • Process of  becoming familiar  with the problem

  • We will need to understand it will before solving

  • The user’s requirements cannot be fulfilled without clear understanding of his and her problem in depth.

2)Algorithm Development:-
  • Step by Step description of the method to solve a problem is called algorithm.

  • Effective process of solving problem in finite number of step  

  • Development of algorithm is a step of program design

Example:-

Problem − Design an algorithm to add two numbers and display the result.

Step 1 − START.

Step 2 − declare three integers a, b & c.

Step 3 − define values of a and b.

Step 4 − add values of a & b(3+4).

Step 5 − store output of step 4 to c.

Step 6 − print c.

Step 7 − STOP.

Three features of algorithm:-

1)Sequence:-

Each step  in the algorithm in executed in the specified order  

2) Decision :-

We have to make decision to do something

If the outcome of the decision is true, one thing is done otherwise other.

If condition then process1

   OR

If condition 

then process1

Else process2

3) Repetition:-

For example

Repeat Fill the water in the kettle Until kettle is full

3)Flowcharting:-

  • Graphical Representation of an algorithm using standard symbols.
  • Includes a set of standard  that are interconnected by flow lines.
  • Flow lines have arrows(direction of flow)
  • Activities are written with in the boxes in English.

Advantages of flowcharts:-

Communication

  • Quickly provide logic, ideas and descriptions of algorithms.

Effective analysis

  • Clear overview of the entire problem

Proper Documentation 

  • Helps us under to understand its logic in future.

Efficient coding

  • More ease with comprehensive flowchart as a guide

Easy  in program debugging and program maintenance

  • Debugging and maintenance of operation  program.



 Example:- Addition of two numbers


 

Things to consider:-

  • There should be the start and stop to the flowchart

  • Only one flow line emerge from a process of symbols

4)Coding:-
  • process of changing high level language into machine level language.(0,1)

  • It is done by special software, Compiler

  • The compilation process tests the  program whether it contains syntax  error Or  not 

  • If syntax error are present, compiler cannot compile the code. 


5)Compilation and Execution:-

  • Once the compilation is completed then the program is linked with other object programs needed for  execution ,

  • There by resulting in a binary program and  then the program is loaded in the memory for the purpose of execution and finally it is executed

  • The program may ask user for input and generates output after processing the inputs.


6)Debugging and Testing:-

  • Debugging is the discovery and correction of programming errors.

  • Some error may remain in the program because the designer/ programmer might have never thought about a particular case

  • When error appears debugging is necessary.

7)Documentation:-
  • Helps to those who use and maintain and extend the program future.

  • Program may be a difficult  even to programmer  who wrote the code after some days 

  • Properly documented program is necessary which will be a useful and efficient in debugging ,testing ,maintenance and redesign process .

Two types of documents:-

  1. Programmer ‘s documentation(Technical Documentation )

  • Maintain redesign and upgrade.

  • Logic DFD, ERD , Algorithm and flowchart. 

  1. User documentation (user manual ) 

  • Support to use of the program .

  • Introduction for installation of program.


 







  






Comments

Popular posts from this blog

Data Types

Error and type of error