Question
answer these correctly please
You must always initialize a reference when you declare it. True False Destructors have one or more parameters in their parameter list. True False It is good practice to immediately initialize a pointer when you declare it. True False A constant member function of a class can call a non-constant member function of that class. True False In general you should change argument variables from within a function to communicate with the rest of your program. True False You cannot assign a constant reference or a constant value to a non-constant reference. True False Game Programmers are limited to the built-in types defined as part of C++ True False You do not need an object of a class to access static members of that class. True False With today's modern computers, chess programs can examine all of the possible moves in all possible chess games before making a move. True False In general, you should avoid directly altering or accessing an object's data members from outside the object's class definition. True False Why is it illegal to return a reference to a local variable from a function? Because the local variable may have the same name as a variable in the calling code. Because the local variable ceases to exist once the function ends. Because you cannot create a reference to a local variable. Because you cannot return a reference from a function. Given that I is an int constant, based on the following code, what is p? const int *const p = &l; a constant pointer a pointer to a constant a constant pointer to a constant a constant reference to a pointer When you pass by value, you send a copy of a variable to a function. send access to a variable to a function. send a variable name to a function. send a request for a value. When you pass a variable to a function by reference, you send a copy of a variable to a function. send access to a variable to a function. send a variable name to a function. send a request for a value. Given that I is an int variable, based on the following code, what is p? int* const p = &l; a constant pointer a pointer to a constant a constant pointer to a constant a constant reference to a pointer If an object is like a house, then a class is like a/an/ emergency exit neighborhood blueprint fire department What symbol must you use when you declare a pointer? * -> & && How many pointers does the following code declare: Int *pScore1, pScore2, pScore3; 0 1 2 3 How many different objects can you instantiate from one class? 1 2 3 no limit An _____ member function allows indirect access to a data member. abstract accessor object initialized
Explanation / Answer
1)true
2)false
3)true ( eepends on the situation)
4)false
5)true
6)true
7)false
8)true
9)true
10)true
11)b
12)c
13)a
14)b
15)a
16)c
17)a
18)b
19)d
20)b