Exam 10: Defining Classes

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If you have a class named myPersonClass, which of the following correctly declare a constructor in the class definition?

(Multiple Choice)
5.0/5
(41)

A function may return a structure.

(True/False)
4.7/5
(43)

Which of the following function declarations will accept either cout or a file stream object as its argument?

(Multiple Choice)
4.9/5
(48)

A class member function that automatically initializes the data members of a class is called

(Multiple Choice)
4.8/5
(39)

Who can access private members in a class?

(Short Answer)
4.8/5
(40)

The double colon ::) is known as the __________ operator.

(Short Answer)
4.7/5
(26)

A member function of a class should be made private

(Multiple Choice)
5.0/5
(40)

If you are designing a class for an ADT, you can tell if the class is an ADT if

(Multiple Choice)
4.8/5
(32)

Data members or member functions of a class that are declared to be private may

(Multiple Choice)
4.8/5
(35)

The constructor of a class that does not have any parameters is called a __________ constructor.

(Short Answer)
4.8/5
(43)

In the following class constructor definition, the part of the header starting with a single colon is called the ________________. BankAccount::BankAccount): balance0), interest0.0)

(Short Answer)
4.8/5
(39)

A member function that allows the user of the class to find out the value of a private data type is called a ___________________.

(Short Answer)
4.9/5
(28)

Developing an ADT means that the user of your class does not have to know the details about how the class is implemented. This is known as

(Multiple Choice)
4.8/5
(45)

Given the following class and object declaration, how would you print out the age and cost of a bottle of wine? Class Wine { Public: Wine); Int getAge); Float getCost); Private: Int age; Float cost; } Wine bottle;

(Multiple Choice)
4.9/5
(38)

In a class, all members are ____________ by default

(Multiple Choice)
4.9/5
(38)

When defining a class, the class should be composed of the kind of values a variable of the class can contain, and

(Multiple Choice)
4.7/5
(43)

In a structure definition, the identifiers declared in the braces are called

(Multiple Choice)
4.7/5
(39)

A Member function that allows the user of the class to see the value in a data member is known as

(Multiple Choice)
4.8/5
(40)

Given the following class definition, what is missing? Class ItemClass { Public: ItemClassint newSize, float newCost); Int getSize); Float getCost); Void setSizeint newSize); Void setCostfloat newCost); Private: Int size; Float cost; };

(Multiple Choice)
4.8/5
(34)

A class in which modifications to the implementation appear to be invisible to the user of the class is known as _________________.

(Short Answer)
4.9/5
(39)
Showing 21 - 40 of 61
close modal

Filters

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