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
To guarantee that the member variables of a class are initialized, you use ____.
(Multiple Choice)
4.8/5
(36)
A(n) ____________________ function of a class changes the values of the member variable(s) of the class.
(Short Answer)
4.8/5
(39)
To create the object code file for any source code file, the command line option ____________________ is used on the system command line.
(Short Answer)
4.8/5
(40)
A constructor with no parameters is called the ____________________ constructor.
(Short Answer)
4.9/5
(36)
-Consider the UML class diagram shown in the accompanying figure. Which of the following is the name of the class?

(Multiple Choice)
4.8/5
(41)
A(n) ____________________ contains the definitions of the functions to implement the operations of an object.
(Short Answer)
5.0/5
(39)
A program or software that uses and manipulates the objects of a class is called a(n) ____________________ of that class.
(Short Answer)
4.8/5
(31)
A class and its members can be described graphically using a notation known as the ____ notation.
(Multiple Choice)
4.7/5
(40)
A class object can be ____. That is, it can be created once, when the control reaches its declaration, and destroyed when the program terminates.
(Multiple Choice)
4.9/5
(32)
In C++ terminology, a class object is the same as a class instance.
(True/False)
5.0/5
(41)
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 in Figure 2. Which of the following variable declarations is correct?
(Multiple Choice)
4.9/5
(42)
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 declaration: rectangleType bigRect;
Which of the following statements is correct?
(Multiple Choice)
4.8/5
(30)
-Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many private members are in the class?

(Multiple Choice)
4.8/5
(44)
Classes were specifically designed in C++ to handle ____________________.
(Short Answer)
4.9/5
(34)
Which of the following class definitions is correct in C++?
(Multiple Choice)
4.8/5
(39)
In C++, the ____ is an operator called the member access operator.
(Multiple Choice)
4.9/5
(36)
If an object is created in a user program, then the object can access both the public and private members of the class.
(True/False)
4.9/5
(35)
A C++ implementation file has the extension ____________________.
(Short Answer)
4.8/5
(29)
Showing 21 - 40 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)