Exam 13: Introduction to Classes

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

Constructor functions are often used to allocate memory that will be needed by the object.

(True/False)
4.9/5
(31)

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?

(Multiple Choice)
4.7/5
(32)

While a class's member functions may be overloaded, the constructor cannot be overloaded.

(True/False)
4.9/5
(39)

Where are class declarations usually stored?

(Multiple Choice)
4.9/5
(31)

Which of the following is automatically called when an object is destroyed?

(Multiple Choice)
4.8/5
(32)

Class objects can be defined prior to the class declaration.

(True/False)
4.8/5
(37)

For the following code, which statement is not true? Class Point { Private: Double y; Double z; Public: Double x; };

(Multiple Choice)
4.8/5
(31)

What is the output of the following program? #include <iostream> using namespace std; class TestClass { Public: \quad TestClass(int x) \quad { cout << x << endl; } \quad TestClass() \quad { cout << "Hello!" << endl; } }; Int main() { \quad TestClass test; \quad return 0; }

(Multiple Choice)
4.8/5
(38)

When a constructor has a member initialization list, the initializations take place

(Multiple Choice)
4.8/5
(39)

The destructor function's return type is

(Multiple Choice)
4.8/5
(34)

Which of the following is a directive used to create an "include guard" that allows a program to be conditionally compiled to prevent a header file from accidentally being included more than once?

(Multiple Choice)
4.7/5
(27)

Destructor functions are often used to free memory that was allocated by the object.

(True/False)
4.9/5
(32)

Objects in an array are accessed with __________.

(Multiple Choice)
4.7/5
(34)

In C++11 you can have one constructor call another constructor in the same class by using

(Multiple Choice)
4.8/5
(26)
Showing 41 - 54 of 54
close modal

Filters

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