Exam 10: Classes and Data Abstraction
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
A(n) ____________________ is a statement specifying the condition(s) that must be true before the function is called.
Free
(Short Answer)
4.7/5
(34)
Correct Answer:
precondition
A member function of a class that only accesses the value(s) of the data member(s) is called a(n) ____ function.
Free
(Multiple Choice)
4.9/5
(30)
Correct Answer:
A
A class object can be ____. That is, it is created each time the control reaches its declaration, and destroyed when the control exits the surrounding block.
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
B
A destructor has the character ____, followed by the name of the class.
(Multiple Choice)
5.0/5
(42)
A(n) ____________________ statement is required by any program that uses a header class file, as well as by the implementation file that defines the operations for that class.
(Short Answer)
4.7/5
(44)
If a member of a class is ____, you cannot access it outside the class.
(Multiple Choice)
4.9/5
(31)
The public members of a class must be declared before the private members.
(True/False)
4.8/5
(33)
class rectangleType
{
public:
void setLengthWidth(double x, double y);
//Postcondition: length = x; width = y;
void print() const;
//Output length and width;
double area();
//Calculate and return the area of the rectangle;
double perimeter();
//Calculate and return the parameter;
rectangleType();
//Postcondition: length = 0; width = 0;
rectangleType(double x, double y);
//Postcondition: length = x; width = y;
private:
double length;
double width;
};
-Consider the accompanying class definition, and the object declaration: rectangleType bigRect(14,10);
Which of the following statements is correct?
(Multiple Choice)
4.8/5
(21)
In C++, you can pass a variable by reference and still prevent the function from changing its value by using the keyword ____ in the formal parameter declaration.
(Multiple Choice)
4.7/5
(40)
As parameters to a function, class objects can be passed by reference only.
(True/False)
4.8/5
(38)
If the heading of a member function of a class ends with the word const, then the function member cannot modify the private member variables, but it can modify the public member variables.
(True/False)
4.8/5
(37)
A ____ sign in front of a member name on a UML diagram indicates that this member is a public member.
(Multiple Choice)
4.7/5
(38)
-The word ____ at the end of the member functions in the accompanying class clockType in Figure 1 specifies that these functions cannot modify the member variables of a clockType object.

(Multiple Choice)
4.9/5
(33)
In C++, class is a reserved word and it defines only a data type.
(True/False)
4.9/5
(38)
The components of a class are called the ____ of the class.
(Multiple Choice)
4.8/5
(35)
Non-static member variables of a class are called the ____________________ variables of the class.
(Short Answer)
4.8/5
(43)
Showing 1 - 20 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)