Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Sixth.

Similar presentations


Presentation on theme: "© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Sixth."— Presentation transcript:

1 © 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman

2 1-2 © 2010 Pearson Addison-Wesley. All rights reserved. 1-2 Figure 2.1 C Language Elements in Miles-to-Kilometers Conversion Program

3 1-3 © 2010 Pearson Addison-Wesley. All rights reserved. 1-3 Figure 2.2 Memory(a) Before and (b) After Execution of a Program

4 1-4 © 2010 Pearson Addison-Wesley. All rights reserved. 1-4 Figure 2.3 Effect of kms = KMS_PER_MILE * miles;

5 1-5 © 2010 Pearson Addison-Wesley. All rights reserved. 1-5 Figure 2.4 Effect of sum = sum + item;

6 1-6 © 2010 Pearson Addison-Wesley. All rights reserved. 1-6 Figure 2.5 Effect of scanf("%lf", &miles);

7 1-7 © 2010 Pearson Addison-Wesley. All rights reserved. 1-7 Figure 2.6 Scanning Data Line Bob

8 1-8 © 2010 Pearson Addison-Wesley. All rights reserved. 1-8 Figure 2.7 General Form of a C Program

9 1-9 © 2010 Pearson Addison-Wesley. All rights reserved. 1-9 Figure 2.8 Evaluation Tree for area = PI * radius * radius;

10 1-10 © 2010 Pearson Addison-Wesley. All rights reserved. 1-10 Figure 2.9 Step-by-Step Expression Evaluation

11 1-11 © 2010 Pearson Addison-Wesley. All rights reserved. 1-11 Figure 2.10 Evaluation Tree and Evaluation for v = (p2 - p1) / (t2 - t1);

12 1-12 © 2010 Pearson Addison-Wesley. All rights reserved. 1-12 Figure 2.11 Evaluation Tree and Evaluation for z - (a + b / 2) + w * -y

13 1-13 © 2010 Pearson Addison-Wesley. All rights reserved. 1-13 Figure 2.12 Supermarket Coin Value Program

14 1-14 © 2010 Pearson Addison-Wesley. All rights reserved. 1-14 Figure 2.12 Supermarket Coin Value Program (cont’d)

15 1-15 © 2010 Pearson Addison-Wesley. All rights reserved. 1-15 Figure 2.13 Batch Version of Miles-to-Kilometers Conversion Program

16 1-16 © 2010 Pearson Addison-Wesley. All rights reserved. 1-16 Figure 2.14 Miles-to-Kilometers Conversion Program with Named Files

17 1-17 © 2010 Pearson Addison-Wesley. All rights reserved. 1-17 Figure 2.15 Compiler Listing of a Program with Syntax Errors

18 1-18 © 2010 Pearson Addison-Wesley. All rights reserved. 1-18 Figure 2.16 A Program with a Run-Time Error

19 1-19 © 2010 Pearson Addison-Wesley. All rights reserved. 1-19 Figure 2.17 Revised Start of main Function for Supermarket Coin Value Program

20 1-20 © 2010 Pearson Addison-Wesley. All rights reserved. 1-20 Figure 2.18 A Program That Produces Incorrect Results Due to & Omission


Download ppt "© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 2: Overview of C Problem Solving & Program Design in C Sixth."

Similar presentations


Ads by Google