Exam 7: Introduction to Classes and Objects

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

A class can only have one constructor.

(True/False)
4.8/5
(37)

If setRadius is a Circle class function and myCircle is a Circle object, which of the following statements would set myCircle's radius to 2.5?

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.8/5
(34)

A C++ member function that uses, but does not change, the value of a member variable is called

(Multiple Choice)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(30)

In C++ and other object- oriented programming languages, ADTs are normally implemented as classes.

(True/False)
4.9/5
(36)

A constructor may have a return type of

(Multiple Choice)
4.8/5
(32)

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

(Multiple Choice)
4.8/5
(41)

member function may be called by a statement in a function that is outside the class.

(Multiple Choice)
5.0/5
(44)

A destructor is a member function that

(Multiple Choice)
4.8/5
(34)

Objects permit data hiding. This means they can keep functions outside the class from

(Multiple Choice)
4.8/5
(40)

If Circle is the name of a class, which of the following statements would create a Circle object named myCircle?

(Multiple Choice)
4.9/5
(33)

If Square is the name of a class, which of the following statements would create a Square object named box?

(Multiple Choice)
4.7/5
(29)

A class may have default constructor(s)and destructor(s).

(Multiple Choice)
4.9/5
(33)

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

(Multiple Choice)
4.7/5
(39)

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
(28)

The name of a destructor must begin with

(Multiple Choice)
4.9/5
(34)

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
(36)

The is used to protect important data.

(Multiple Choice)
4.7/5
(43)
Showing 21 - 40 of 40
close modal

Filters

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