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
A member function that allow the user of the class to change the value in a data member is known as
Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
A
Different class may not have member functions with the same name.
Free
(True/False)
4.7/5
(37)
Correct Answer:
False
A member function that allows the user of the class to change the value of a private data type is called a ____________________.
(Short Answer)
4.9/5
(38)
C++11 allows you to directly set the member variables to initial values in the definition of the class. This feature is called __________________.
(Short Answer)
4.9/5
(32)
A structure definition ends with the closing brace and a _________.
(Short Answer)
5.0/5
(36)
given the following class definition, how could you use the constructor to assign values to an object of this class?
Class CDAccount
{
Public:
CDAccount);
CDAccountfloat interest, float newBalance);
Float getBalance);
Float getRate);
Void setRatefloat interest);
Void setBalancefloat newBalance);
Private:
Float balance, rate;
};
And the following object declaration
CDAccount myAccount;
(Multiple Choice)
5.0/5
(44)
Which part of the ADT tells the programmer using it how to use it?
(Multiple Choice)
4.8/5
(34)
Given the following strucure definition, what is the correct way to initialize a variable called today?
Struct DateType
{
Int day;
Int month;
Int year;
}
(Multiple Choice)
4.8/5
(45)
Given the following class, what would be the best declaration for a constructor that would allow the user to initialize the object with an initial age and cost?
Class Wine
{
Public:
Wine);
Int getAge);
Float getCost);
Private:
Int age;
Float cost;
}
(Multiple Choice)
4.9/5
(31)
A member function that gets called automatically when an object of the class is declared is called a _______________.
(Short Answer)
4.7/5
(39)
What is wrong with the following structure definition?
Struct MyStruct
{
Int size;
Float weight;
}
(Multiple Choice)
4.8/5
(34)
Showing 1 - 20 of 61
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)