1) Modify a prototype. The following prototype describes a class of type Square.
ID: 3902179 • Letter: 1
Question
1)
Modify a prototype. The following prototype describes a class of type Square. However, the code may have some bugs. Copy and paste this prototype, and correct any mistakes in the prototype. However, (You will then use this prototype in next 4 questions.) DO NOT change whether the overloaded operator is a member, non-member, or friend.
2)
Modify this overloaded operator definition if needed.
If the code is already perfect, write, "NO CHANGE NEEDED"
3)
Modify this overloaded operator definition if needed.
If the code is already perfect, write, "NO CHANGE NEEDED"
4)
Modify this overloaded operator definition if needed.
If the code is already perfect, write, "NO CHANGE NEEDED"
5)
Modify this overloaded operator definition if needed.
If the code is already perfect, write, "NO CHANGE NEEDED"
6)
Select all answers that apply: is there a memory bug in this code?
>Yes: shallow copy instead of deep copyExplanation / Answer
2) NO CHANGE NEEDED
3) NO CHANGE NEEDED
4) NO CHANGE NEEDED
5)
6) No, there is no memory bug
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.