Download presentation
Presentation is loading. Please wait.
Published byCory Shelton Modified over 9 years ago
1
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Selection Structures: if and switch Statements Problem Solving and Program Design in C 5th Edition by Jeri R. Hanly and Elliot B. Koffman
2
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2 Figure 4.1 Evaluation Tree and Step-by-Step Evaluation for !flag || (y + z >= x - z)
3
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3 Figure 4.2 Range of True Values for min <= x && x <= max
4
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4 Figure 4.3 Range of True Values for z > x || x > y
5
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5 Figure 4.4 Flowcharts of if Statements with (a) Two Alternatives and (b) One Alternative
6
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6 Figure 4.5 if Statement to Order x and y
7
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7 Figure 4.6 Structure Chart for Water Bill Problem
8
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 8 Figure 4.7 Program for Water Bill Problem
9
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 9 Figure 4.7 Program for Water Bill Problem (cont’d)
10
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 10 Figure 4.7 Program for Water Bill Problem (cont’d)
11
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11 Figure 4.7 Program for Water Bill Problem (cont’d)
12
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 12 Figure 4.8 Sample Run of Water Bill Program
13
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 13 Figure 4.9 Function comp_use_charge Revised
14
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 14 Figure 4.9 Function comp_use_charge Revised (cont’d)
15
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 15 Figure 4.10 Function comp_tax
16
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16 Figure 4.10 Function comp_tax (cont’d)
17
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 17 Figure 4.11 Flowchart of Road Sign Decision Process
18
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 18 Figure 4.12 Example of a switch Statement with Type char Case Labels
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.