Question: 5. Suppose that the foo class does not have an overloaded assignment operator. What happens when an assignment a b; is given for two foo
5. Suppose that the foo class does not have an overloaded assignment operator. What happens when an assignment a b; is given for two foo objects? o A. Compiler error o B. Run-time error o C. The automatic assignment operator is used o D. The copy constructor is used o E. None of the above 6. When should you use a const reference parameter? o A. Whenever the data type might be many bytes. o B. Whenever the data type might be many bytes, the function changes the parameter within its body, and you DO want these changes to alter the actual argument. o C. Wh enever the data type might be many bytes, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument. D. Whenever the data type might be many bytes, and the function does not change the parameter within its body. o 7. Consider this class definition: class quiz public quiz(); int f() const; int g(); private: double score; Which functions can carry out an assignment score-1.0; to the private member variable score? o A. Both f and g can carry out the assignment. o B. f can carry out the assignment, but not g. o C. g can carry out the assignment, but not f o D. Neither f nor g can carry out the assignment. 8. Who needs to know about the invariant of an ADT? o A. Only the programmer who uses the class for the ADT. o B. Only the programmer who implements the class for the ADT. o C. Both the programmer who implements the class and the programmer who uses the class. o D. Neither the programmer who implements the class nor the programmer who uses the class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
