Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions