Problem Solving and Algorithm Design: Nell Dale - John Lewis
Problem Solving and Algorithm Design: Nell Dale - John Lewis
Problem Solving
and Algorithm Design
Nell Dale John Lewis
Chapter Goals
62
Chapter Goals (cont.)
63
Problem Solving
64
Problem Solving
65
Ask Questions...
67
Divide and Conquer
68
Algorithms
69
Computer Problem-Solving
610
Figure 6.3: The Interactions
Between Problem-Solving Phases
611
Pseudocode
Page 149
612
Following an Algorithm
Figure 6.4
613
Following an Algorithm (cont.)
Page 150
614
Developing an Algorithm
615
Top-Down Design
616
Top-Down Design
Figure 6.5
An example
of top-down
design
617
A General Example
Problem
Create an address list that includes each
persons name, address, telephone number,
and e-mail address
This list should then be printed in alphabetical
order
The names to be included in the list are on
scraps of paper and business cards
619
A Computer Example
Page 156
620
A Computer Example
Page 157
621
A Computer Example
Page 158
622
A Computer Example
Page 159
623
Testing the Algorithm
624
Testing the Algorithm
625
Object-Oriented Design
626
Object-Oriented Design
627
Relationships Between Classes
Containment
part-of
An address class may be part of the definition
of a student class
Inheritance
Classes can inherit data and behavior from
other classes
is-a
628
Object-Oriented Design
Methodology
Four stages to the decomposition process
Brainstorming
Filtering
Scenarios
Responsibility algorithms
629
CRC Cards
Page 165
630
Brainstorming
631
Filtering
632
Scenarios
633
Responsibility Algorithms
634
Computer Example
Page 171
635
Computer Example
Page 172
Computer Example
Filtered list
Page 172
CRC Cards
Page 173
638
Responsibility Algorithms
Page 175
639
Information Hiding
640
Information Hiding
641
Programming Languages
642
Ethical Issues: Plagiarism
643