Exam 10: Classes and Data Abstraction

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

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:
Verified

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:
Verified

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:
Verified

B

A destructor has the character ____, followed by the name of the class.

(Multiple Choice)
5.0/5
(42)

A class is an example of a structured data type.

(True/False)
4.8/5
(48)

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. -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)

Object code is produced from a(n) ____________________.

(Short Answer)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(35)

How many destructors can a class have?

(Multiple Choice)
4.8/5
(39)

In C++, the scope resolution operator is ____.

(Multiple Choice)
4.9/5
(40)

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
close modal

Filters

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