Introduction to Programming in C++
Seventh Edition
Chapter 2:
Beginning the Problem-Solving Process• Explain the problem-solving process used to create a
computer program
• Analyze a problem
• Complete an IPO chart
...
Introduction to Programming in C++
Seventh Edition
Chapter 2:
Beginning the Problem-Solving Process• 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
Chapter Objectives
An Introduction to Programming with C++, Seventh Edition 2• People solve hundreds of simple problems every day
without thinking about how they do it
• Understanding the thought process involved can help in
solving more complex problems
• You can also use a similar process to design a computer
solution to a problem (computer program)
Problem Solving
An Introduction to Programming with C++, Seventh Edition 3• First step in solving a problem: analyze it
– Example: paying and mailing a bill
• Next, you plan, review, implement, and evaluate the
solution
• After this, it may be necessary to modify the solution
Solving Everyday Problems
An Introduction to Programming with C++, Seventh Edition 4Solving Everyday Problems
(cont’d.)
Figure 2-1 Summary of the analysis and planning steps for
the bill paying problem
An Introduction to Programming with C++, Seventh Edition 5Solving Everyday Problems
(cont’d.)
Figure 2-2 Modified algorithm for the bill paying problem
An Introduction to Programming with C++, Seventh Edition 6• Solve the following problem:
– Steps needed to log on to a school computer
• Be sure to use
– Items used to accomplish the goal
– Algorithm
– Goal
• Make your solution similar to pages 22 and 23
Solve This Problem
An Introduction to Programming with C++, Seventh Edition 7• A similar process to everyday problem solving is used to
create computer programs
• A computer program is a solution implemented on a
computer
• There are six steps to creating a computer solution to a
problem
Creating Computer Solutions to
Problems
An Introduction to Programming with C++, Seventh Edition 8Creating Computer Solutions to
Problems (cont’d.)
Figure 2-3 How to create a computer solution to a problem
An Introduction to Programming with C++, Seventh Edition 9• It is essential to understand a problem before creating a
solution to it
• Analyze a problem to:
– Determine the goal of solving it (Output)
– Determine the items needed to achieve that goal (Input)
• Always search first for the output
Step 1−Analyzing
[Show More]