CHAP11 - Chapter 11 Structured Types, Data Abstraction, and...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 11 Structured Types, Data Abstraction, and Classes Chapter 11 STRUCTURED TYPES, DATA ABSTRACTION,  AND CLASSES CHAPTER GOALS To be able to declare a record ( struct ) data type a data structure whose components may be nonhomogeneous. To be able to access a member of a record variable. To be able to use arrays of records to solve a given problem. To be able to define a hierarchical record structure. To be able to access values stored in a hierarchical record variable. To understand the general concept of a C++ union type. To be able to choose and design an appropriate array and/or record data structure for a given problem. To understand the difference between specification and implementation of an abstract data type. To be able to declare a C++ class type. To be able to declare class objects, given the declaration of a class type. To be able to write client code that invokes class member functions. To be able to implement class member functions. To understand how encapsulation and information hiding are enforced by the C++ compiler. To be able to organize the code for a C++ class into two files: the specification file and the implementation file. To be able to write a C++ class constructor. CHAPTER OUTLINE I. Simple Versus Structured Data Types A. Records (C++ structs) B. Accessing Individual Components C. Aggregate Operations on Structs D. More About Struct Declarations E. Hierarchical Records II. Unions III. Data Abstraction IV. Abstract Data Types Theoretical Foundations : Categories of Abstract Data Type Operations V. C++ Classes Matters of Style : Declaring Public and Private Class Members A. Classes, Class Objects, and Class Members B. Built-In Operations on Class Objects C. Class Scope D. Information Hiding VI. Specification and Implementation Files A. The Specification File B. The Implementation File C. Compiling and Linking a Multifile Program 194
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 11 Structured Types, Data Abstraction, and Classes VII. Guaranteed Initialization with Class Constructors A. Invoking a Constructor B. Revised Specification and Implementation Files for TimeType C. Guidelines for Using Class Constructors VIII. Problem-Solving Case Study : Manipulating Dates IX. Testing and Debugging A. Testing and Debugging Hints X. Summary GENERAL DISCUSSION Records ( struct s in C++) provide additional flexibility in the design of data structures. Their use involves two new concepts. The first is that a data structure may contain values of different data types. Until now, the concept of a structured data type has been limited to a collection of values that are all of the same type. With struct s, however, we now have the ability to compose structures that are collections of different types of values. The second new concept is that components of a data structure may be accessed by name rather than by
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

CHAP11 - Chapter 11 Structured Types, Data Abstraction, and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online