Answer to Question #41107 in C++ for CT

Question #41107
The class Figure is the base class. You should add only Rectangle and Triangle
classes derived from Figure . Each class has stubs for member functions erase
and draw . Each of these member functions outputs a message telling what function
has been called and what the class of the calling object is. Since these are
just stubs, they do nothing more than output this message. The member function
center calls erase and draw to erase and redraw the figure at the center.
Because you have only stubs for erase and draw , center will not do any “centering”
but will call the member functions erase and draw . Also, add an output
message in the member function center that announces that center is being
called. The member functions should take no arguments. There are three parts
to this project:

a. Do the class definitions using no virtual functions. Compile and test.
b. Make the base class member functions virtual. Compile and test.
c. Explain the difference in results.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS