Chapter 10


1.

What are the four principles of object-oriented theory?

abstraction, encapsulation, inheritance, and polymorphism

2.

What is encapsulation?

placing the data and the functions that work on that data together

3.

What is the relationship between structures and classes?

a class is essentially a structure with functions.

4.

What is the greatest advantage with object-oriented programming?

code reusability

5.

Why are classes frequently defined in header files?

for two reasons: first, because of their complexity, and, second, to make them more reusable

6.

What is inheritance?

when one class gets a copy of the public methods and variables of another class.

7.

Give a definition for a class.

a template for creating objects

8.

What is the term for a function that is part of a class?

method

9.

What is the term for a variable that is part of a class?

property

Answers

1.

Abstraction, encapsulation, inheritance, and polymorphism

2.

Placing the data and the functions that work on that data together

3.

A class is essentially a structure with functions.

4.

Code reusability

5.

For two reasons: First, because of their complexity, and, second, to make them more reusable

6.

When one class gets a copy of the public methods and variables of another class.

7.

A template for creating objects

8.

Method

9.

Property




C++ Programming Fundamentals
C++ Programming Fundamentals (Cyberrookies)
ISBN: 1584502371
EAN: 2147483647
Year: 2005
Pages: 197
Authors: Chuck Easttom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net