2. Circle the correct answer. Suppose a function has a parameter named x, and the body of the function
changes the value of x. When should x be a value
A. If you want the actual argument to remain unchanged
B. If you want changes to x to affect the actual argument
3. True or False. A const reference parameter in a function prototype guarantees that the actual argument will
not be altered by the function.
4. Circle the answer that is true for the statement below. Make only one selection
The Invariant of a class
A. Provides rules that specify which C++ operators can be overloaded
B. Provide rules that specify how member variables of a class represent a value
C. Provides rules that specify how assignment operators and the copy constructors will be used in a class
5. Select all are that true in List B about the code in Figure B below.
Figure B.
1. class ksu
2. {
3. public:
4. ksu();
5. double gpa();
6. int numclasses() const;
7. private:
8. int studentid;
9. };
List B
A. The numclasses() function can examine the status of a ksu object but cannot modify the object
B. The ksu(), gpa(), and numclasses() functions are all modification functions
C. The ksu() function can examine the status of a ksu object but cannot modify the object
D. The studentid class member most likely supports information hiding because a programmer who uses the ksu class is
not concerned with the value of studentid
E. The gpa() function can modify the value of a ksu object
6. Circle only the formulas that are O(n)
A. $16n^2$
B. $n^2+n+2$
C. $[n^2/2]$
D. $10n+25$