Exam 10: Classes and Data Abstraction
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 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 (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
In C++,the ____ is an operator called the member access operator.
(Multiple Choice)
4.9/5
(40)
A member function of a class that only accesses the value(s)of the data member(s)is called a(n)____ function.
(Multiple Choice)
4.9/5
(40)
Figure 2:
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.7/5
(39)
A(n)____________________ function of a class changes the values of the member variable(s)of the class.
(Short Answer)
4.8/5
(41)
A program or software that uses and manipulates the objects of a class is called a(n)____________________ of that class.
(Short Answer)
4.9/5
(36)
If a member of a class is ____,you cannot access it outside the class.
(Multiple Choice)
4.8/5
(35)
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)
Which of the following class definitions is correct in C++?
(Multiple Choice)
4.9/5
(38)
A(n)____________________ is a statement specifying what is true after the function call is completed.
(Short Answer)
4.8/5
(33)
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.
(Multiple Choice)
4.9/5
(30)
A(n)____________________ contains the definitions of the functions to implement the operations of an object.
(Short Answer)
4.9/5
(32)
Figure 1:
-Consider the UML class diagram shown in the accompanying figure.Which of the following is the name of the class?

(Multiple Choice)
4.9/5
(34)
A class and its members can be described graphically using a notation known as the ____ notation.
(Multiple Choice)
4.9/5
(41)
A constructor with no parameters is called the ____________________ constructor.
(Short Answer)
4.9/5
(35)
As parameters to a function,class objects can be passed by reference only.
(True/False)
5.0/5
(31)
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)
5.0/5
(34)
If a class object is passed by ____________________,the contents of the member variables of the actual parameter are copied into the corresponding member variables of the formal parameter.
(Short Answer)
4.9/5
(40)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)