0% found this document useful (0 votes)
35 views4 pages

Module 2: Beginning The Problem - Solving Process

1) The document discusses the problem-solving process for creating computer programs, including analyzing problems, planning algorithms using flowcharts and pseudocode, and desk-checking algorithms. 2) It explains the steps as analyzing the problem to understand inputs and outputs, planning a solution, implementing it, and testing results. 3) Key aspects of problem analysis are identifying input and output, optional use of IPO charts, and ensuring full understanding before design.

Uploaded by

Crisalyn Bacani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Module 2: Beginning The Problem - Solving Process

1) The document discusses the problem-solving process for creating computer programs, including analyzing problems, planning algorithms using flowcharts and pseudocode, and desk-checking algorithms. 2) It explains the steps as analyzing the problem to understand inputs and outputs, planning a solution, implementing it, and testing results. 3) Key aspects of problem analysis are identifying input and output, optional use of IPO charts, and ensuring full understanding before design.

Uploaded by

Crisalyn Bacani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Module 2: Beginning the Problem – Solving Process

Overview
This chapter stresses the importance of proper design in the programming
process. It also shows where design fits in the overall process of problem
solving. Different methods of designing the solution to a problem are
shown (flowcharts and pseudocode). Several examples of implementing
the problem-solving process are given.

Objectives
After completing the chapter, the student will be able to:

• Explain the problem-solving process used to create a computer


program
• Analyze a problem
• Complete an IPO chart
• Plan an algorithm using pseudocode and flowcharts
• Desk-check an algorithm

Solving Everyday Problems


1. The first step in solving a familiar problem is to analyze the
problem, identifying the important components and the goal.
Knowing the resources, you have available to solve the problem
is part of this step as well.
2. Once the problem is fully understood, you then plan a solution
for the problem, review it, implement it, evaluate your results,
and modify it if necessary.

Creating Computer Solutions to Problems


1. Designing computer solutions to problems follows the same
process as that in the previous section addressing everyday
problems. The only difference is that the solutions are
implemented with a computer.
2. The next three major sections cover the first three steps in
designing a computer solution to a problem: analyzing the
problem, planning an algorithm, and desk-checking the
algorithm. Chapters 3 and 4 will cover the last three steps:
coding the algorithm into a program, desk-checking the
program, and evaluating and modifying (if necessary) the
program.
3. Other texts may have slightly different steps in their explanation
of the problem-solving process, but they will all be similar in the
sense of beginning with an analysis of the problem, designing an
algorithmic solution, implementing the solution, and testing
(debugging) the solution.

Step 1–Analyze the Problem


1. Understanding a problem is essential to solving it. To
understand a problem, you must analyze it, which involves
identifying its important components.
2. The two most important components of any problem are the
problem’s output, or goal, and its input, or the items needed to
achieve the goal.
3. The output of a problem can usually be identified by asking the
question “what information does the user want displayed,
printed, or stored?”
4. The input of a problem can usually be identified by asking the
question “what information will the computer need to know to
display, print, or store the output items?”
5. Some programmers use an IPO chart to organize and summarize
the results of the analysis step. IPO stands for input, processing,
and output. It takes the form of three columns, the first and third
of which contain the input and output of the problem,
respectively. The middle column contains the processing items,
or information and instructions needed to solve the problem that
don’t appear in the input or output.

Hints for Analyzing Problems


1. Make sure you understand the problem before trying to design
an algorithm to solve it. The analysis step is the most important,
and sometimes several readings of the problem are necessary to
understand all of the details.
2. It may be useful to cross out all of the irrelevant information in
the problem description, leaving only the parts that are essential
to solving the problem.
3. Some problems may contain incomplete information, whereas
others may leave out information that is implicit, or common
knowledge. Recognizing the difference between these two
situations and asking for more information when necessary are
essential skills.

Step 2–Plan the Algorithm


1. Designing an algorithm to solve the problem amounts to writing
down the specific set of steps the computer will execute to
achieve the goal.
2. The processing column of an IPO chart should be filled in with
the relevant input items and the sequence of instructions that
will be performed on those items. It can be written in two forms,
either in pseudocode or as a flowchart.
3. A flowchart uses symbols to represent different components of
the problem and how they relate to each other in the sequence
structure. The symbols are connected by lines called flowlines,
which indicate the temporal relationships between different
items.
4. The oval symbol in a flowchart is the start/stop symbol, one of
each indicating the beginning and end of the flowchart. The
input/output symbol (a parallelogram) represents input tasks or
output tasks. Finally, the rectangle is the process symbol, which
is used to represent tasks such as calculations.
5. Pseudocode is an English-like description of the components of
a flowchart, containing short statements that are not actual
computer code but that give the basic idea of what a given step
in the algorithm is supposed to compute.
6. Often it will be necessary to include processing items in the
pseudocode or flowchart of an algorithm. A processing item is
one that represents an intermediate value necessary for
computing another processing item or output item. It is
information that is neither input nor output.

Step 3–Desk-Check the Algorithm


1. After analyzing a problem and planning an algorithm to solve it,
it is essential to verify that the algorithm works. Before
programming the solution into a computer, it is helpful to desk-
check the algorithm by hand.
2. Desk-checking refers to the fact that the programmer reviews
the algorithm by hand, rather than by running it on a computer.
This is also called hand-tracing.
3. Desk-checking can be done reliably by making a chart with one
column for each input, processing, and outputting an item in the
IPO chart and then manually running through each step of the
algorithm given in the processing column of the IPO chart while
writing down the values of each item as it is referenced or
changed in the algorithm.
4. The algorithm should be checked both with valid data, or data
that the algorithm is expecting the user to enter, and invalid data,
or data the algorithm is not expecting. This is to ensure that the
algorithm will be able to handle user error in an elegant way.

Key Terms
• Desk-checking — the process of manually walking through each
of the instructions in an algorithm; also called hand-tracing
• Flowchart — a tool that programmers use to help them plan (or
depict) an algorithm; consists of standardized symbols
connected by flowlines
• Flowlines — the lines that connect the symbols in a flowchart
• Hand-tracing — another term for desk-checking
• Input — the items a program needs in order to achieve the
output
• Input/Output Symbol — the parallelogram in a flowchart; used
to represent input and output tasks
• Invalid Data — data that the algorithm is not expecting the user
to enter
• IPO — an acronym for input, processing, and output
• IPO Chart — a chart that some programmers use to organize and
summarize the results of a problem analysis
• Output — the goal of solving a problem; the items the user
wants to display, print, or store
• Process Symbol — the rectangle symbol in a flowchart; used to
represent tasks such as calculations
• Processing Item — an intermediate value (neither input nor
output) that an algorithm uses when processing the input into the
output
• Pseudocode — a tool that programmers use to help them plan an
algorithm; consists of short English statements; means false
code
• Start/Stop Symbol — the oval symbol in a flowchart; used to
mark the beginning and end of the flowchart
• Valid Data — data that the algorithm is expecting the user to
enter

You might also like