Exam 10: Classes and Data Abstraction

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

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

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

True

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

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

True

Non-static member variables of a class are called the ____________________ variables of the class.

Free
(Short Answer)
4.8/5
(33)
Correct Answer:
Verified

instance

A C++ implementation file has the extension ____________________.

(Short Answer)
4.8/5
(44)

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.8/5
(34)

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.

(True/False)
4.8/5
(33)

Figure 2: class rectangleType { public: \quad void setLengthWidth(double x, double y); \quad\quad //Postcondition: length = x; width = y; \quad void print() const; \quad\quad //Output length and width; \quad double area(); \quad\quad //Calculate and return the area of the rectangle; \quad double perimeter(); \quad\quad //Calculate and return the parameter; \quad\quad rectangleType(); \quad\quad //Postcondition: length = 0; width = 0; \quad rectangleType(double x, double y); \quad\quad //Postcondition: length = x; width = y; private: \quad double length; \quad double width; }; -Consider the accompanying class definition in Figure 2.Which of the following variable declarations is correct?

(Multiple Choice)
4.7/5
(40)

Given the declaration class myClass { public: void print(); //Output the value of x; MyClass(); private: int x; }; myClass myObject; The following statement is legal. myObject.x = 10;

(True/False)
4.8/5
(30)

The header file is also known as the ____________________.

(Short Answer)
4.7/5
(37)

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.8/5
(36)

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

(Multiple Choice)
4.9/5
(24)

Classes were specifically designed in C++ to handle ____________________.

(Short Answer)
4.9/5
(37)

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

(True/False)
4.9/5
(35)

Object code is produced from a(n)____________________.

(Short Answer)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(46)

      -How many destructors can a class have?       -How many destructors can a class have? -How many destructors can a class have?

(Multiple Choice)
4.9/5
(28)

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

(Multiple Choice)
4.9/5
(45)

Figure 1: Figure 1:    -Consider the UML class diagram shown in the accompanying figure.According to the UML class diagram,how many private members are in the class? -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
(40)

If a function of a class is static,it is declared in the class definition using the keyword static in its ____.

(Multiple Choice)
5.0/5
(38)

What does ADT stand for?

(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 50
close modal

Filters

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