Homework #10
- Goal:
Learn the concept of class inheritance and virtual functions in C++.
- Students
93321003, 93321047, 94321002, 94321005, 94321007, 94321008, 94321010
must demonstrate their programs to Prof. Wu.
- Please UPLOAD your homework (ZIP or RAR file) to TA at
http://ms11.voip.edu.tw/cs102/
- Deadline: 2008/4/25 10:00 AM
- Requirement: Modify Ex9_10 by adding a member function ShowCost() to the
class CContainer.
- The cost of a CBox object is equal to its surface area, i.e.,
2*(Length*Width + Width*Height + Height*Length).
- The cost of a CCan object is equal to its surface area, too.
- The cost of a CGlassBox object is equal to its surface area
plus 15% of its volume.
- Modify Ex9_10.cpp to show the dimension, volume and cost of a CBox, CCan,
and CGlassBox object, respectively.