Presentation is loading. Please wait.

Presentation is loading. Please wait.

Problem Solving Techniques

Similar presentations


Presentation on theme: "Problem Solving Techniques"— Presentation transcript:

1 Problem Solving Techniques

2 Six Steps to program problem solving.
Problem definition Problem analysis Algorithm design Top-down approach Pseudocode Program flowchart Program coding Program testing and debugging Program documentation

3 Problem definition Describe the problem in a clear and precise statement. We know exactly what needs to be done.

4 Problem analysis Understand completely the input data required and the output produced by the program. What are the input data? What are their data types? What are the output data? What are the output formats?

5 Algorithm design Algorithm is a specification of a method to solve a problem.

6 Stepwise refinement Subdivide the problem into sub-problems. Each sub-problem is further divided into smaller sub-problems. Process is repeated until each sub-problem is one that is easy to be solved. The above process is known as Stepwise refinement.

7 Top-down design If the decomposition starts at the top level and then works down, It is called Top-down design. The task identified at each level of subdivision is called a module. The module can be implemented by procedure in Pascal.

8 Pseudocode A sequence of English-like statements that represent an algorithm. The algorithm is written using a language similar to programming languages.

9 Program flowcharts Used to illustrate the logic structures, they are sequence, selection and loop graphically.

10 Program Coding Write the program in programming language is called coding. Write structure program with modules.

11 A good program should be
Use modular approach Easy to read

12 Program testing and debugging
Debugging is test the program and get rid of bugs. Three types of Programming error: Syntax error Grammatical rules of the programming language. Run-time error Errors occurred when program is running. Eg. Divided by zero. Logical error Incorrect algorithm or incorrect implementation of an algorithm produce incorrect or unexpected result.

13 Program documentation
Consists of written descriptions about the program. Used to make others can understand the program.


Download ppt "Problem Solving Techniques"

Similar presentations


Ads by Google