Please enable JavaScript.
Coggle requires JavaScript to display documents.
Ch.21 Problem-solving Procedures - Coggle Diagram
Ch.21 Problem-solving Procedures
21.1 Problem-solving Concepts
use computers as a tool
Problem-solving
The process of analyzing the description of a problem until we reach a solution
develop computer programs to generate solutions to solve
complex problems
21.1.1 The need for a systematic way of solving problems
Solving a problem in an organized and systematic way can greatly enhance the chances of finding the best solution.
split a problem into several smaller and simpler parts which are called subproblems.
solve them individually and after that combine them together to give a whole solution to the original problem.
called divide and conquer.
Solving a problem in a systematic way means breaking a problem into some smaller and more manageable modules.
usually easier to solve a smaller module than a bigger one.
A series of intermediate steps are required to be developed in the process of finding the solution.
We can trace any mistakes made in the process more easily by examining what is happening at every step
21.2 Problem-solving Procedures
Algorithm design
A finite sequence of steps arranged in specific logical order to generate a solution to a problem
Pseudocode
A way to represent an algorithm in narrative form
Flowchart
A way to represent the logic and actions of an algorithm graphically
Problem identification
The initial step of solving a problem
➢ Obtain a precise definition of the problem
➢ Asking questions about the problem can help identify the problem more clearly.
Problem analysis
In-depth consideration of the identified problem
Look into the problem from different perspectives in order to diagnose it correctly and gain a full picture of it.
Developing a solution
Top-down approach
divided into some manageable subproblems.
can avoid making mistakes in the process of developing a
solution.
helps us understand how data is transmitted among modules.
Debugging and testing
Test
Ensure that a program works and is free of error
Debug
The process of locating and fixing defects in a program
programming errors:
run time error
Logic error
Syntax error
Documentation
program manual:
Technical details about
• problem statements
• specification of requirements
• algorithms
• test data and sample outputs
a user manual
How to install the program
• How to start the program
• The functions provided by the program
• How to use the program to
• How to handle simple errors and the meaning of the error messages
needs for documentation:
Help programmers maintain the program in the future.
Help new comers familiarize themselves with the program easily.
Help programmers discover errors in the program.
Users can learn how to use the program through a user manual.
21.4 Different Ways to Solve the Same Problems
The bottom-up approach
Start at the component level or the concrete level and the components are grouped
together to form a system.
The top-down approach
Start at the system level or the abstract level and divides the task into several manageable
modules.