Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume the existence of a class GraphicProgram with a string member,executableNa

ID: 3661002 • Letter: A

Question

Assume the existence of a class GraphicProgram with a string member,executableName, and data member, windowPtr, of type Window * (where Window is also a class type). Assume further that the Window class has a function called clone, that takes no parameters and returns a pointer to a new copy of the Window. Write a copy constructor for the GraphicProgram class that uses the clone function to make a proper copy of the Window member (rather than simple member assignment). The executable member may be copied using simple member assignment.

Explanation / Answer

GraphicProgram(const GraphicProgram &a){
executableName=a.executableName;
windowPtr=a.windowPtr->clone();
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote