Chapter 14

¡Supera tus tareas y exámenes ahora con Quizwiz!

1

) It is a good idea to make a copy constructor's parameters ________ by specifying the ________ key word in the parameter list. A) inline, inline B) static, static C) constant, const D) global, global E) None of these 0AnswerC

2

) Object composition is useful for creating this type of relationship between classes. A) friend B) static C) has a D) conditional E) None of these 0AnswerC

12) If a member variable is declared ________, all objects of that class have access to that variable. A) static B) dynamic C) inline D) default E) None of these

AnswerA

3) This operator may be used to assign one object to another. A) = B) == C) <> D) @ E) None of these

AnswerA

1) Each object of a class has its own copy of the class's ________. A) member functions B) member variables C) constructor and destructor functions D) All of these E) None of these

AnswerB

18) To overload the + operator, you would write a function named ________. A) overload + B) operator + C) function + D) operator.overload(+) E) None of these

AnswerB

19) This is a special built-in pointer that is available to a class's member functions. A) overloaded -> operator B) this pointer C) &constructor pointer D) ~destructor *ptr E) None of these

AnswerB

6) When objects contain pointers, it is a good idea to create an explicit ________ function. A) destructor B) copy constructor C) static constructor D) inline constructor E) None of these

AnswerB

7) A good reason for overloading an operator is to enable it to ________. A) outperform its C language counterparts B) work in its usual way, but with programmer-defined data types C) operate on more operands than in its standard definition D) operate on no operands E) None of these

AnswerB

9) If you do not furnish one of these, an automatic memberwise copy will be performed when one object is assigned to another object. A) overloaded constructor function B) overloaded assignment operator C) default constructor function D) overloaded copy operator E) None of these

AnswerB

11) A reason to overload the ________ is to write classes that have array-like behaviors. A) parentheses ( ) operator B) curly braces { } operator C) square brackets [ ] operator D) colon : : operator E) None of these

AnswerC

13) A member function that is declared ________ may not access any non-static data members in the class. A) private B) public C) static D) inline E) None of these

AnswerC

15) This is a special function that is called whenever a new object is created and initialized with another object's data. A) destructor B) static function C) copy constructor D) assignment function E) None of these

AnswerC

17) When you redefine the way a standard operator works when it is used with class objects, you have ________ the operator. A) reassigned B) reformatted C) overloaded D) overwhelmed E) None of these

AnswerC

21) An ________ operator can work with programmer-defined data types. A) inline B) unconditional C) overloaded D) undefined E) None of these

AnswerC

23) A(n) ________ informs the compiler that a class will be declared later in the program. A) static function B) private data member C) forward declaration D) object conversion E) None of these

AnswerC

24) In the following function header: FeetInches FeetInches::operator++(int) the word (int) is known as a(n): A) parameterless data type B) incomplete argument C) dummy parameter D) incomplete parameter E) None of these

AnswerC

5) C++ allows you to redefine the way ________ work when used with class objects. A) compiler errors B) preprocessor directives C) standard operators D) undefined variables E) None of these

AnswerC

8) When a class contains an instance of another class, it is known as ________. A) object overloading B) operator overloading C) object composition D) dynamic composition E) None of these

AnswerC

14) This type of function is not a member of a class, but it has access to the private members of the class. A) static B) constructor C) destructor D) friend E) None of these

AnswerD

16) If you do not furnish one of these a default will be provided for you by the compiler. A) copy constructor B) constructor C) destructor D) All of these E) None of these

AnswerD

2) This type of member variable may be accessed before any objects of the class have been created. A) private B) public C) inline D) static E) None of these

AnswerD

22) When you overload an operator, you cannot change the number of ________ taken by the operator. A) arguments B) parameters C) operations D) operands E) None of these

AnswerD

4) C++ requires that a copy constructor's parameter be a(n) ________. A) integer data type B) floating point data type C) pointer variable D) reference object E) None of these

AnswerD


Conjuntos de estudio relacionados

PARAGRAPHS: Paragraph Flow, paragraph editing Quiz

View Set

We The People Ch. 4 (Inquizitive)

View Set

CS397 - Natural Language Processing MIDTERM REVIEW

View Set

CyberSecurity Midterm Study Questions (Quiz #1-5)

View Set

Chapter 24: Management of Patients With Chronic Pulmonary Disease

View Set

Chapter 2 Quiz Types of Policies

View Set

Microeconomics Final Exam Review

View Set

Driver's Manual: Part 12, Driving Emergencies

View Set

CRMS Unit 3: Federalist vs. Antifederalists - Who would say that?

View Set

Organizational Behavior Ch.9/11 Quiz

View Set