Filters
Question type

Study Flashcards

The destructor function's return type is:


A) tilde
B) int
C) float
D) nothing. Destructors have no return type.
E) None of the above.

F) A) and E)
G) None of the above

Correct Answer

verifed

verified

D

More than one destructor function may be defined for a class.

A) True
B) False

Correct Answer

verifed

verified

Objects are created from abstract data types that encapsulate _______ and _______ together.


A) numbers, characters
B) data, functions
C) addresses, pointers
D) integers, floats
E) None of these

F) C) and D)
G) A) and B)

Correct Answer

verifed

verified

A private member function is useful for tasks that are internal to the class, but is not directly called by statements outside the class.

A) True
B) False

Correct Answer

verifed

verified

You must use the private access specification for all data members of a class.

A) True
B) False

Correct Answer

verifed

verified

In a procedural program, you typically have __________stored in a collection of variables, and a set of __________ that perform operations on the data.


A) numbers, arguments
B) parameters, arguments
C) strings, operators
D) data, functions
E) None of these

F) A) and E)
G) A) and C)

Correct Answer

verifed

verified

The process of object-oriented analysis can be viewed as the following steps:


A) Identify objects, then define objects' attributes, behaviors, and relationships
B) Define data members and member functions, then assign a class name
C) Declare private and public variables, prototype functions, then write code
D) Write the main() function, then determine which classes are needed
E) None of these

F) A) and B)
G) C) and D)

Correct Answer

verifed

verified

A class is a(n) _____________ that is defined by the programmer.


A) data type
B) function
C) method
D) attribute
E) None of these

F) A) and D)
G) C) and D)

Correct Answer

verifed

verified

Object-oriented programming is centered around the object, which encapsulate together both the data and the functions that operate on the data.

A) True
B) False

Correct Answer

verifed

verified

For the following code, which statement is not true? class Point { \quad private: \quad\quad double y; \quad\quad double z; \quad public: \quad\quad double x; };


A) x is available to code that is written outside the class.
B) The name of the class is Point.
C) x, y, and z are called members of the class.
D) z is available to code that is written outside the class.

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

The constructor function always has the same name as


A) the first private data member
B) the first public data member
C) the class
D) the first object of the class
E) None of these

F) A) and B)
G) A) and D)

Correct Answer

verifed

verified

Class declarations are usually stored here.


A) On separate disk volumes
B) In their own header files
C) In .cpp files, along with function definitions
D) Under pseudonyms
E) None of these

F) B) and D)
G) A) and B)

Correct Answer

verifed

verified

Objects in an array are accessed with ________, just like any other data type in an array.


A) subscripts
B) parentheses
C) #include statements
D) output format manipulators
E) None of these

F) A) and B)
G) B) and C)

Correct Answer

verifed

verified

In OOP terminology, an object's member variables are often called its _________, and its member functions are sometimes referred to as its behaviors, or ____________.


A) values, morals
B) data, activities
C) attributes, activities
D) attributes, methods
E) None of these

F) A) and D)
G) B) and E)

Correct Answer

verifed

verified

D

More than one constructor function may be defined for a class.

A) True
B) False

Correct Answer

verifed

verified

A ___________ is a member function that is automatically called when a class object is ___________.


A) destructor, created
B) constructor, created
C) static function, deallocated
D) utility function, declared
E) None of these

F) A) and D)
G) D) and E)

Correct Answer

verifed

verified

Members of a class object are accessed with the


A) dot operator.
B) cin object.
C) extraction operator.
D) stream insertion operator.
E) None of these

F) A) and E)
G) C) and D)

Correct Answer

verifed

verified

When a constructor function accepts no arguments, or does not have to accept arguments because of default arguments, it is called a(n) :


A) empty constructor
B) default constructor
C) stand-alone function
D) arbitrator function
E) None of these

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

B

Assume that myCar is an instance of the Car class, and that the Car class has a member function named accelerate. Which of the following is a valid call to the accelerate member function?


A) Car->accelerate() ;
B) myCar::accelerate() ;
C) myCar.accelerate() ;
D) myCar:accelerate() ;

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Class objects can be defined prior to the class declaration.

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 46

Related Exams

Show Answer