Exam 7: Introduction to Classes and Objects

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

An Abstract data type (AD T) is a programmer-defined data type that specifies the values the type can hold, the operations that can be performed on them, and how the operations will be implemented.

Free
(True/False)
4.8/5
(46)
Correct Answer:
Verified

False

When three different objects of a class are created, they are said to be separate ________ of the class.

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

C

When the body of a member function is defined inside a class declaration, it is called a(n) ________ function.

Free
(Multiple Choice)
5.0/5
(31)
Correct Answer:
Verified

C

When an object or structure variable is passed to a function as a constant reference

(Multiple Choice)
4.8/5
(39)

A destructor is a member function that

(Multiple Choice)
4.8/5
(31)

The bundling of an object's data and functions together is called

(Multiple Choice)
4.7/5
(32)

A constructor is a public class function that is automatically invoked (i.e., called) whenever a class object is created.

(True/False)
4.8/5
(41)

A constructor that does not require that any arguments be passed to it is called a(n) ________ constructor.

(Multiple Choice)
4.9/5
(33)

A structure variable is similar to a class object in which of the following ways?

(Multiple Choice)
4.9/5
(34)

A structure has member variables, like an object, but they are usually all public and accessed directly with the dot operator, instead of by calling member functions.

(True/False)
4.8/5
(36)

The ________ is used to protect important data.

(Multiple Choice)
4.9/5
(34)

If setSide is a Square class function and box is a Square object, which of the following statements would set the length of box's side to 5?

(Multiple Choice)
4.8/5
(30)

An object typically hides its data, but allows outside code to access it through its

(Multiple Choice)
4.8/5
(38)

An object is a(n) ________ of a class.

(Multiple Choice)
4.9/5
(28)

A constructor is a public class function that gets called whenever you want to re-initialize an object's member data.

(True/False)
4.9/5
(31)

A C++ member function that sets or changes the value stored in a member variable is called

(Multiple Choice)
5.0/5
(47)

Public members of a class object can be accessed from outside the class by using the

(Multiple Choice)
4.9/5
(34)

Accessors are sometimes called ________ functions and mutators are sometimes called ________ functions.

(Multiple Choice)
5.0/5
(33)

What will the following code segment display? Enum Season {Spring, Summer, Fall, Winter} favoriteSeason; FavoriteSeason = Summer; Cout << favoriteSeason;

(Multiple Choice)
4.8/5
(35)

A(n) ________ member function may be called by a statement in a function that is outside of the class.

(Multiple Choice)
4.9/5
(30)
Showing 1 - 20 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)