Download presentation
Presentation is loading. Please wait.
Published byAngela Rich Modified over 9 years ago
1
© 2012Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program Design in C Seventh Edition By Jeri R. Hanly & Elliot B. Koffman
2
1-2 © 2012 Pearson Addison-Wesley. All rights reserved. 1-2 Figure 5.1 Flow Diagram of Loop Choice Process
3
1-3 © 2012 Pearson Addison-Wesley. All rights reserved. 1-3 Figure 5.2 Program Fragment with a Loop
4
1-4 © 2012 Pearson Addison-Wesley. All rights reserved. 1-4 Figure 5.3 Flowchart for a while Loop
5
1-5 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.4 Program to Compute Company Payroll 1-5
6
1-6 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.4 Program to Compute Company Payroll (cont’d) 1-6
7
1-7 © 2012 Pearson Addison-Wesley. All rights reserved. 1-7 Figure 5.5 Using a for Statement in a Counting Loop
8
1-8 © 2012 Pearson Addison-Wesley. All rights reserved. 1-8 Figure 5.6 Comparison of Prefix and Postfix Increments
9
1-9 © 2012 Pearson Addison-Wesley. All rights reserved. 1-9 Figure 5.7 Function to Compute Factorial
10
1-10 © 2012 Pearson Addison-Wesley. All rights reserved. 1-10 Figure 5.8 Displaying a Celsius-to- Fahrenheit Conversion Table
11
1-11 © 2012 Pearson Addison-Wesley. All rights reserved. 1-11 Figure 5.9 Program to Monitor Gasoline Storage Tank
12
1-12 © 2012 Pearson Addison-Wesley. All rights reserved. 1-12 Figure 5.9 Program to Monitor Gasoline Storage Tank (cont’d)
13
1-13 © 2012 Pearson Addison-Wesley. All rights reserved. 1-13 Figure 5.9 Program to Monitor Gasoline Storage Tank (cont’d)
14
1-14 © 2012 Pearson Addison-Wesley. All rights reserved. 1-14 Figure 5.10 Sentinel-Controlled while Loop
15
1-15 © 2012 Pearson Addison-Wesley. All rights reserved. 1-15 Figure 5.11 Batch Version of Sum of Exam Scores Program
16
1-16 © 2012 Pearson Addison-Wesley. All rights reserved. 1-16 Figure 5.12 Program to Process Bald Eagle Sightings for a Year
17
1-17 © 2012 Pearson Addison-Wesley. All rights reserved. 1-17 Figure 5.12 Program to Process Bald Eagle Sightings for a Year (cont’d)
18
1-18 © 2012 Pearson Addison-Wesley. All rights reserved. 1-18 Figure 5.13 Nested Counting Loop Program
19
1-19 © 2012 Pearson Addison-Wesley. All rights reserved. 1-19 Figure 5.14 Validating Input Using do-while Statement
20
1-20 © 2012 Pearson Addison-Wesley. All rights reserved. 1-20 Figure 5.15 Six Root for the Equation f(x)=0
21
1-21 © 2012 Pearson Addison-Wesley. All rights reserved. 1-21 Figure 5.16 Using a Function Parameter
22
1-22 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.17 Change of Sign Implies an Odd Number of Roots 1-22
23
1-23 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.18 Three Possibilities That Arise When the Interval [X left, X right ] Is Bisected 1-23
24
1-24 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.19 Finding a Function Root using Bisection Method 1-24
25
1-25 © 2012 Pearson Addison-Wesley. All rights reserved. 1-25 Figure 5.19 Finding a Function Root using Bisection Method (cont’d)
26
1-26 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.19 Finding a Function Root using Bisection Method (cont’d) 1-26
27
1-27 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.19 Finding a Function Root using Bisection Method (cont’d) 1-27
28
1-28 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.20 Sample Run of Bisection Program with Trace Code Included 1-28
29
1-29 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.21 Nested Rectangles for a Quilt Pattern 1-29
30
1-30 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.22 Program to draw a quilt 1-30
31
1-31 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.23 Program to draw a moving ball 1-31
32
1-32 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.23 Program to draw a moving ball (cont’d) 1-32
33
1-33 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.24 Trace of the moving ball 1-33
34
1-34 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.25 Geometric Interpretation of Newton’s Method 1-34
35
1-35 © 2012 Pearson Addison-Wesley. All rights reserved. Figure 5.26 Approximating the Area Under a Curve with Trapezoids 1-35
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.