Classes- Information Hiding Labels - correct answer ✔public, private,
protected
Classes- Object - correct answer ✔An instance of class
Classes- Members can be? - correct answer ✔Data/variables,
Functions/Methods
Classes- A parameter to a constructor optional - correct answer ✔True-
default parameters
Classes- Initializer list - correct answer ✔Initialization list is used to initialize
the data members directly
Classes- Explicit Constructor - correct answer ✔Avoids automatic type
conversion
Classes- Constant member functions (accessor) - correct answer ✔A
member function that examines but does not change the state of its object,
const functions
Classes- Constant member functions (mutators) - correct answer ✔A
member function that changes the state of its object, non-const functions
Interface - correct answer ✔#include in .cpp files
,Benefits of Preprocessor commands - correct answer ✔Guards against
multiple inclusion of .h files
Scope-resolution operator - correct answer ✔:: symbol, used to identify the
class corresponding to each function
True or False: Function signatures must match in both interface and
implementation - correct answer ✔true
Default parameters are specified only in the __________ - correct answer
✔interface
Legal or illegal object declarations
- IntCell obj3=37;
- IntCell obj4(); - correct answer ✔Illegal
Legal or illegal object declarations
- IntCell obj1;
- IntCell obj2(12); - correct answer ✔Legal
New object declarations supported in c++ 11 - correct answer ✔- IntCell
obj5{12}
- IntCell obj6{}
Initialize a vector - correct answer ✔vector<int> squares(100)
Standard string class - correct answer ✔compared with ==, <, ect, can be
assigned using =, and gives length () functions
, Initialization of vectors using {} - correct answer ✔vector<int> vec1={1, 2, 3};
vector<int> vec2{1, 2, 3};
What does vector<int> vec3(12); do? - correct answer ✔specifying size of
the vector
What does vector<int> vec4{12}; do? - correct answer ✔value initialization
Range-based for loop
(squares, int x) - correct answer ✔for (int x : squares) {
}
Keyword auto - correct answer ✔do not need to specify the type
auto i=20;
Pointer variable - correct answer ✔Stores the address of another object/data
in memory
Declaration of a pointer - correct answer ✔* before the variable name
Address- of operator & - correct answer ✔&obj gives the address where obj
is stored
Dynamic object creations - correct answer ✔Using the new keyword