- 1.
- Without writing any code, sketch out how you might create classes
to represent Points, Triangles, Rectangles and Squares. How might
the class hierarchy be extended to deal with Cuboids, Cubes and
Prisms?
- 2.
- Write a program to show the order in which constructors and
destructors are called in a hierarchy of derived classes.
- 3.
- Create a class containing 2 integers, then create an object of that
class. See if the address of the object is the same as the address of
one of the fields.
- © Cambridge University, Engineering Department, Trumpington Street, Cambridge CB2 1PZ, UK (map)
Tel: +44 1223 332600, Fax: +44 1223 332662
Contact: helpdesk