Exam 10: Classes and Data Abstraction

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

If an object is declared in the definition of a member function of the class, then the object can access both the public and private members of the class.

Free
(True/False)
4.8/5
(73)
Correct Answer:
Verified

True

In C++, the ____ is called the member access operator.

Free
(Multiple Choice)
5.0/5
(73)
Correct Answer:
Verified

A

To guarantee that the member variables of a class are initialized, you use ____.

Free
(Multiple Choice)
4.7/5
(73)
Correct Answer:
Verified

C

A(n) ____________________ is a statement specifying the condition(s) that must be true before the function is called.

(Short Answer)
4.9/5
(84)

Given this declaration:myClass myObject; The following statement is legal. Given this declaration:myClass myObject; The following statement is legal.    myObject.x = 10; myObject.x = 10;

(True/False)
4.9/5
(73)

The public members of a class must be declared before the private members.

(True/False)
4.9/5
(78)

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.9/5
(65)

Which of the following class definitions is correct in C++?

(Multiple Choice)
4.9/5
(84)

Figure 2: Figure 2:   -Consider the accompanying class definition, and the object declaration:rectangleType bigRect(14,10); Which of the following statements is correct? -Consider the accompanying class definition, and the object declaration:rectangleType bigRect(14,10); Which of the following statements is correct?

(Multiple Choice)
4.9/5
(84)

A(n) ____________________ function of a class changes the values of the member variable(s) of the class.

(Short Answer)
4.9/5
(70)

The header file is also known as the ____________________.

(Short Answer)
4.9/5
(85)

In C++ terminology, a class object is the same as a class instance.

(True/False)
4.9/5
(76)

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
(70)

A ____ sign in front of a member name on a UML diagram indicates that this member is a public member.

(Multiple Choice)
4.8/5
(84)

The components of a class are called the ____ of the class.

(Multiple Choice)
4.9/5
(83)

  -Consider the UML class diagram shown in the accompanying figure.Which of the following is the name of the class? -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
(88)

In C++, class is a reserved word and it defines only a data type.

(True/False)
4.8/5
(71)

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.9/5
(77)

Figure 2: Figure 2:   -Consider the accompanying class definition, and the declaration:rectangleType bigRect; Which of the following statements is correct? -Consider the accompanying class definition, and the declaration:rectangleType bigRect; Which of the following statements is correct?

(Multiple Choice)
5.0/5
(72)

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
(79)
Showing 1 - 20 of 43
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)