Вы находитесь на странице: 1из 55

Chapter 1

General Problem Solving Concepts


Problem Solving and Programming Concepts

9th Edition
By Maureen Sprankle and Jim Hubbard

Copyright 2012 Pearson Education, Inc.

Overview

Problem Solving in Everyday Life


Types of Problems
Problem Solving with Computers
Difficulties with Problem Solving

Copyright 2012 Pearson Education, Inc.

0-2

Objectives
1. Describe difference between heuristic,
algorithmic solutions.
2. List, describe problem-solving steps for
algorithmic solution.
3. Use problem-solving steps to solve
problem.

Copyright 2012 Pearson Education, Inc.

0-3

Problem Solving in Everyday Life


1.
2.
3.
4.
5.
6.

Identify the problem.


Understand the problem.
Identify alternative ways to solve problem.
Select best alternative.
List solution steps for alternative chosen.
Evaluate solution.

Copyright 2012 Pearson Education, Inc.

0-4

Types of Problems
Problems with
Algorithmic solutions
Heuristic solutions
Combination of algorithmic, heuristic
solutions

Copyright 2012 Pearson Education, Inc.

0-5

Problem Solving with Computers


Definitions:
Solution instructions followed to
produce best result
Result outcome, computer-assisted
answer
Program instructions for solution using
computer language

Copyright 2012 Pearson Education, Inc.

0-6

Difficulties with Problem Solving

Lack of problem solving experience


Inadequate solution steps
Incorrect problem definition
Alternatives chosen incorrectly
Invalid logic
Incorrect solution evaluation

Copyright 2012 Pearson Education, Inc.

0-7

Chapter 1
General Problem Solving Concepts

End Chapter 9

Copyright 2012 Pearson Education, Inc.

Chapter 2
Beginning Problem-Solving
Concepts for the Computer
Problem Solving and Programming Concepts

9th Edition
By Maureen Sprankle and Jim Hubbard

Copyright 2012 Pearson Education, Inc.

Overview

Constants and Variables


Data Types
How the Computer Stores Data
Functions
Operators
Expressions and Equations

Copyright 2012 Pearson Education, Inc.

0-10

Objectives

1. Differentiate between variables,


constants.
2. Differentiate between character, numeric,
and logical data types.
3. Identify operators, operands, resultants.

Copyright 2012 Pearson Education, Inc.

0-11

Objectives
5. Identify, use functions
6. Identify, use operators according to
placement in hierarchy chart.
7. Set up, evaluate expressions and
equations using variables, constants,
operators, and the hierarchy of
operations.

Copyright 2012 Pearson Education, Inc.

0-12

Figure 2.1 Important Concepts to


Learn

Copyright 2012 Pearson Education, Inc.

0-13

Table 2.1 Constants and


Variables on the Computer

Copyright 2012 Pearson Education, Inc.

0-14

Table 2.1 Constants and


Variables on the Computer

Copyright 2012 Pearson Education, Inc.

0-15

Rules for Naming and Using


Variables
1. Name a variable according to what it
represents.
2. Do not use spaces.
3. Start a variable name with a letter.
4. Do not use a dash or any other symbol
that is used as a mathematical operator.

Copyright 2012 Pearson Education, Inc.

0-16

Rules for Naming and Using


Variables
5. Consistent usage of variable name.
6. Consistent use of upper, lowercase
characters in variable names

Copyright 2012 Pearson Education, Inc.

0-17

Table 2.3 Data Types


and Their Data Sets

Copyright 2012 Pearson Education, Inc.

0-18

Table 2.4 Examples of Data Types

Copyright 2012 Pearson Education, Inc.

0-19

Table 2.4 Examples of Data Types

Copyright 2012 Pearson Education, Inc.

0-20

Table 2.5 Functions

Copyright 2012 Pearson Education, Inc.

0-21

Table 2.6 Operators and Their


Computer Symbols

Copyright 2012 Pearson Education, Inc.

0-22

Table 2.6 Operators and Their


Computer Symbols

Copyright 2012 Pearson Education, Inc.

0-23

Table 2.7 Definitions of the Logical


Operators

Copyright 2012 Pearson Education, Inc.

0-24

Table 2.7 Definitions of the Logical


Operators

Copyright 2012 Pearson Education, Inc.

0-25

Table 2.7 Definitions of the Logical


Operators

Copyright 2012 Pearson Education, Inc.

0-26

Table 2.8 Hierarchy of Operations

Copyright 2012 Pearson Education, Inc.

0-27

Table 2.8 Hierarchy of Operations

Copyright 2012 Pearson Education, Inc.

0-28

Table 2.9 Expressions and Equations

Copyright 2012 Pearson Education, Inc.

0-29

Evaluating a Mathematical
Expression

Copyright 2012 Pearson Education, Inc.

0-30

Evaluating a Relational Expression

Copyright 2012 Pearson Education, Inc.

0-31

Evaluating a Logical Expression

Copyright 2012 Pearson Education, Inc.

0-32

Evaluating an Equation That Uses


Both Relational and Logical
Operators

Copyright 2012 Pearson Education, Inc.

0-33

Chapter 2
Beginning Problem-Solving
Concepts for the Computer

End Chapter 2

Copyright 2012 Pearson Education, Inc.

Chapter 3
Planning Your Solution
Problem Solving and Programming Concepts

9th Edition
By Maureen Sprankle and Jim Hubbard

Copyright 2012 Pearson Education, Inc.

Overview

Communicating with the Computer


Organizing the Solution
Using the Tools
List and describe development tools
Use problem analysis chart
Use interactivity chart
Use IPO (Input-Process-Output) chart
Use algorithms and flowcharts

Copyright 2012 Pearson Education, Inc.

0-36

Analyzing the Problem


Understand requirements:
1. The given data
2. The required results
3. The processing that is required in the
problem
4. A list of solution alternatives

Copyright 2012 Pearson Education, Inc.

0-37

Figure 3.1 Problem Analysis Chart

Copyright 2012 Pearson Education, Inc.

0-38

Figure 3.2 Problem Analysis Chart for


the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-39

Figure 3.3 The Interactivity Chart

Copyright 2012 Pearson Education, Inc.

0-40

Figure 3.4 The Completed Interactivity


Chart

Copyright 2012 Pearson Education, Inc.

0-41

Figure 3.5 The Interactivity Chart for


the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-42

Figure 3.6 The IPO Chart

Copyright 2012 Pearson Education, Inc.

0-43

Figure 3.7 The IPO Chart for the


Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-44

Figure 3.8 The Form of an Algorithm

Copyright 2012 Pearson Education, Inc.

0-45

Figure 3.9 Flowchart Symbols

Copyright 2012 Pearson Education, Inc.

0-46

Figure 3.9 Flowchart Symbols

Copyright 2012 Pearson Education, Inc.

0-47

Figure 3.9 Flowchart Symbols

Copyright 2012 Pearson Education, Inc.

0-48

Figure 3.9 Flowchart Symbols

Copyright 2012 Pearson Education, Inc.

0-49

Figure 3.10 The Algorithms and


Flowcharts for the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-50

Figure 3.10 The Algorithms and


Flowcharts for the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-51

Figure 3.10 The Algorithms and


Flowcharts for the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-52

Figure 3.10 The Algorithms and


Flowcharts for the Payroll Problem

Copyright 2012 Pearson Education, Inc.

0-53

Figure 3.11 Order of Execution of


Instructions

Copyright 2012 Pearson Education, Inc.

0-54

Chapter 3
Planning Your Solution

End Chapter 3

Copyright 2012 Pearson Education, Inc.

Вам также может понравиться