chapter 8: arrays

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

Upload: winifred-foster

Post on 31-Dec-2015

43 views

Category:

Documents


0 download

DESCRIPTION

Chapter 8: Arrays. Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman. Figure 8.1 The Eight Elements of Array x. Figure 8.2 Arrays answer and score. Figure 8.3 Program to Print a Table of Differences. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 8: Arrays

© 2010 Pearson Addison-Wesley. All rights reserved.

Addison Wesley is an imprint of

Chapter 8:Arrays

Problem Solving & Program Design in C

Sixth Edition

By Jeri R. Hanly &

Elliot B. Koffman

Page 2: Chapter 8: Arrays

1-2

1-2

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.1 The Eight Elements of Array x

Page 3: Chapter 8: Arrays

1-3

1-3

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.2 Arrays answer and score

Page 4: Chapter 8: Arrays

1-4

1-4

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.3 Program to Print a Table of Differences

Page 5: Chapter 8: Arrays

1-5

1-5

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.3 Program to Print a Table of Differences (cont’d)

Page 6: Chapter 8: Arrays

1-6

1-6

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.4 Data Area for Calling Module and Function do_it

Page 7: Chapter 8: Arrays

1-7

1-7

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.5  Function fill_array

Page 8: Chapter 8: Arrays

1-8

1-8

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.6 Data Areas Before Return from fill_array (x, 5, 1);

Page 9: Chapter 8: Arrays

1-9

1-9

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.7 Function to Find the Largest Element in an Array

Page 10: Chapter 8: Arrays

1-10

1-10

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.8 Diagram of a Function That Computes an Array Result

Page 11: Chapter 8: Arrays

1-11

1-11

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.9 Function to Add Two Arrays

Page 12: Chapter 8: Arrays

1-12

1-12

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.10 Function Data Areas for add_arrays(x, y, x_plus_y, 5);

Page 13: Chapter 8: Arrays

1-13

1-13

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.11 Diagram of Function fill_to_sentinel

Page 14: Chapter 8: Arrays

1-14

1-14

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.12 Function Using a Sentinel-Controlled Loop to Store Input Data in an Array

Page 15: Chapter 8: Arrays

1-15

1-15

© 2010 Pearson Addison-Wesley. All rights reserved.

Figure 8.13 Driver for Testing fill_to_sentinel