1
Chapter 15On to C++
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-2
Figure 15.1 Comparison of (a) C and (b) C++ Control Structures
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-3
Figure 15.1 Comparison of (a) C and (b) C++ Control Structures (cont’d)
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-4
Figure 15.2 Implementing Output Parameters in C and C++
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-5
Figure 15.3 “Donut” Model of an Abstract Data Type
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-6
Figure 15.4 “Donut” Model of Standard Type int
2
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-7
Figure 15.5 Comparison of Models of Standard Type int and Abstract Data Type Complex
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-8
Figure 15.6Header File for Class Complex
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-9
Figure 15.7Implementation File for Class Complex
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-10
Figure 15.7Implementation File for Class Complex (cont’d)
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-11
Figure 15.7 Implementation File for Class Complex (cont’d)
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-12
Figure 15.8 Driver Function to Test Class Complex
3
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-13
Figure 15.9 Step-by-Step Evaluation of Multiple << Operations
Copyright ©2004 Pearson Addison-Wesley. All rights reserved. 15-14
Figure 15.10 Declaration of Class Ratio