chapter 1 general problem solving concepts solution. 3. use problem-solving steps to solve problem....

55
Copyright © 2012 Pearson Education, Inc. Chapter 1 General Problem Solving Concepts Problem Solving and Programming Concepts 9 th Edition By Maureen Sprankle and Jim Hubbard

Upload: hakhue

Post on 09-Apr-2018

237 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Chapter 1

General Problem Solving Concepts

Problem Solving and Programming Concepts

9th Edition

By Maureen Sprankle and Jim Hubbard

Page 2: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc. 0-2

Overview

• Problem Solving in Everyday Life

• Types of Problems

• Problem Solving with Computers

• Difficulties with Problem Solving

Page 3: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

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.

0-3

Page 4: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Problem Solving in Everyday Life

1. Identify the problem.

2. Understand the problem.

3. Identify alternative ways to solve problem.

4. Select best alternative.

5. List solution steps for alternative chosen.

6. Evaluate solution.

0-4

Page 5: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Types of Problems

Problems with …

• Algorithmic solutions

• Heuristic solutions

• Combination of algorithmic, heuristic

solutions

0-5

Page 6: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Problem Solving with Computers

Definitions:

• Solution instructions followed to

produce best result

• Result outcome, computer-assisted

answer

• Program instructions for solution using

computer language

0-6

Page 7: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Difficulties with Problem Solving

• Lack of problem solving experience

• Inadequate solution steps

• Incorrect problem definition

• Alternatives chosen incorrectly

• Invalid logic

• Incorrect solution evaluation

0-7

Page 8: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Chapter 1

General Problem Solving Concepts

End Chapter 9

Page 9: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

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

Page 10: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc. 0-10

Overview

• Constants and Variables

• Data Types

• How the Computer Stores Data

• Functions

• Operators

• Expressions and Equations

Page 11: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Objectives

1. Differentiate between variables,

constants.

2. Differentiate between character, numeric,

and logical data types.

3. Identify operators, operands, resultants.

0-11

Page 12: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

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.

0-12

Page 13: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 2.1 Important Concepts to

Learn

0-13

Page 14: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.1 Constants and

Variables on the Computer

0-14

Page 15: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.1 Constants and

Variables on the Computer

0-15

Page 16: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

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.

0-16

Page 17: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Rules for Naming and Using

Variables

5. Consistent usage of variable name.

6. Consistent use of upper, lowercase

characters in variable names

0-17

Page 18: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.3 Data Types

and Their Data Sets

0-18

Page 19: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.4 Examples of Data Types

0-19

Page 20: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.4 Examples of Data Types

0-20

Page 21: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.5 Functions

0-21

Page 22: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.6 Operators and Their

Computer Symbols

0-22

Page 23: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.6 Operators and Their

Computer Symbols

0-23

Page 24: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.7 Definitions of the Logical

Operators

0-24

Page 25: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.7 Definitions of the Logical

Operators

0-25

Page 26: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.7 Definitions of the Logical

Operators

0-26

Page 27: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.8 Hierarchy of Operations

0-27

Page 28: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.8 Hierarchy of Operations

0-28

Page 29: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Table 2.9 Expressions and Equations

0-29

Page 30: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Evaluating a Mathematical

Expression

0-30

Page 31: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Evaluating a Relational Expression

0-31

Page 32: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Evaluating a Logical Expression

0-32

Page 33: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Evaluating an Equation That Uses

Both Relational and Logical

Operators

0-33

Page 34: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Chapter 2

Beginning Problem-Solving

Concepts for the Computer

End Chapter 2

Page 35: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Chapter 3

Planning Your Solution

Problem Solving and Programming Concepts

9th Edition

By Maureen Sprankle and Jim Hubbard

Page 36: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc. 0-36

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

Page 37: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

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

0-37

Page 38: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.1 Problem Analysis Chart

0-38

Page 39: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.2 Problem Analysis Chart for

the Payroll Problem

0-39

Page 40: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.3 The Interactivity Chart

0-40

Page 41: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.4 The Completed Interactivity

Chart

0-41

Page 42: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.5 The Interactivity Chart for

the Payroll Problem

0-42

Page 43: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.6 The IPO Chart

0-43

Page 44: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.7 The IPO Chart for the

Payroll Problem

0-44

Page 45: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.8 The Form of an Algorithm

0-45

Page 46: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.9 Flowchart Symbols

0-46

Page 47: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.9 Flowchart Symbols

0-47

Page 48: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.9 Flowchart Symbols

0-48

Page 49: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.9 Flowchart Symbols

0-49

Page 50: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.10 The Algorithms and

Flowcharts for the Payroll Problem

0-50

Page 51: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.10 The Algorithms and

Flowcharts for the Payroll Problem

0-51

Page 52: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.10 The Algorithms and

Flowcharts for the Payroll Problem

0-52

Page 53: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.10 The Algorithms and

Flowcharts for the Payroll Problem

0-53

Page 54: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Figure 3.11 Order of Execution of

Instructions

0-54

Page 55: Chapter 1 General Problem Solving Concepts solution. 3. Use problem-solving steps to solve problem. 0-3 Copyright © 2012 Pearson Education, Inc. Problem Solving in Everyday Life 1

Copyright © 2012 Pearson Education, Inc.

Chapter 3

Planning Your Solution

End Chapter 3