Advanced OOP using C++

Practice Test

What is Object-Oriented Programming?

Published:  August 26, 2008
By Richard G. Baldwin

File: AdvCpp00110PracticeTest


Questions

1.  True or False:  You must always program using an object-oriented paradigm when programming with C++.

Answer and Explanation

2.  True or False:  In OOP, the expression of an algorithm should model the application domain that it supports.

Answer and Explanation

3.  True or False:  If a program is object oriented, it adheres to the characteristics of:

Answer and Explanation

4.  True or False:  An object-oriented program has four fundamental characteristics:

However, some authors combine the first and second of these characteristics, resulting in only three fundamental characteristics.

Answer and Explanation

5.  True or False:  An object is an instance of a data type.

Answer and Explanation

6.  True or False:  Abstraction is the definition of an abstract data type, which includes the data type's representation and behavior.

Answer and Explanation

7.  True or False:  The jargon instantiate is used by programmers as a verb to describe the creation of an instance of a data type, or the creation of a function.

Answer and Explanation

8.  True or False:  A programmer encapsulates the data representation and behavior of an abstract data type into a class, giving it its own implementation and interface.

Answer and Explanation

9.  True or False:  An encapsulated design hides its implementation from the class user while revealing its data members.

Answer and Explanation

10.  True or False:  C++ OOP produces good designs by default.

Answer and Explanation

11.  True or False:  Method is another name for C++ member functions. Methods may be data members, destructors, functions, and overloaded operators. They define the class interface.

Answer and Explanation

12.  True or False:  A message is the invocation of a method, which in C++ is the same thing as calling the public member function. The program sends a message to an object telling it to execute the method and sometimes provides parameters for the method to use.

Answer and Explanation

13.  True or False:  There are three different kinds of methods characterized by how they support the class definition:

Answer and Explanation

14.  True or False:  Typical method variants for functional methods include the following actions:

Answer and Explanation

15.  True or False:  Data type methods make a class act like a primitive data type by giving it properties similar to those of a primitive data type. These properties are usually implemented as overloaded operators in the class interface.

Answer and Explanation

16True or False:  If you write an expression where the compiler expects an abstract data type, and you provide a different data type, primitive or abstract, the compiler knows inherently how to deal with that.  Similarly, if the expression expects a primitive data type, and you use an abstract data type, the compiler knows what to do.

Answer and Explanation

17True or False:  A new class can inherit the characteristics of an existing class.

Answer and Explanation

18True or False:  A program can instantiate objects of a base class as well as those of a derived class provided that the base class is an abstract base class.

Answer and Explanation

19True or False:  Multiple inheritance is a powerful and trouble-free programming concept, so you should never hesitate to use it.

Answer and Explanation

20True or False:  C++ supports three kinds of polymorphism:

Answer and Explanation



Copyright 2008, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is a combination of Java, C#, and XML. In addition to the many platform and/or language independent benefits of Java and C# applications, he believes that a combination of Java, C#, and XML will become the primary driving force in the delivery of structured information on the Web.

Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas.  He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.

In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP).  His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments.  (TI is still a world leader in DSP.)  In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.

Baldwin@DickBaldwin.com

 


Answers and Explanations


Answer 20

False

Explanation 20

Back to Question 20
 


Answer 19

False

Explanation 19

Back to Question 19


Answer 18

False

Explanation 18

Back to Question 18


Answer 17

True

Explanation 17

Back to Question 17


Answer 16

False

Explanation 16

Back to Question 16


Answer 15

True

Explanation 15

Back to Question 15


Answer 14

True

Explanation 14

Back to Question 14


Answer 13

True

Explanation 13

Back to Question 13


Answer 12

True

Explanation 12

Back to Question 12


Answer 11

False

Explanation 11

Back to Question 11


Answer 10

False

Explanation 10

Back to Question 10


Answer 9

False

Explanation 9

Back to Question 9


Answer 8

True

Explanation 8

Back to Question 8


Answer 7

False

Explanation 7

Back to Question 7


Answer 6

True

Explanation 6

Back to Question 6


Answer 5

True

Explanation 5

Back to Question 5


Answer 4

True

Explanation 4

Back to Question 4


Answer 3

False

Explanation 3

Back to Question 3


 

Answer 2

True

Explanation 2

Back to Question 2


Answer 1

False

Explanation 1

Back to Question 1


Copyright 2008, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is a combination of Java, C#, and XML. In addition to the many platform and/or language independent benefits of Java and C# applications, he believes that a combination of Java, C#, and XML will become the primary driving force in the delivery of structured information on the Web.

Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas.  He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers. He has also published articles in JavaPro magazine.

In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP).  His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments.  (TI is still a world leader in DSP.)  In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.

Baldwin@DickBaldwin.com

 

-end-