Exam 10: Defining Classes
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
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)
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)