Need Help ?

Home / Expert Answers / Other / Description In this assignment a class hierarchy is created with three classes. The three classes a

Description In this assignment a class hierarchy is created with three classes. The three classes a ...


Description In this assignment a class hierarchy is created with three classes. The three classes are described below. Ship class (include Ship.h and Ship.cpp) Contains data members for the following String for name of the ship Integer for the year the ship was built Constructor with parameters Accessors and mutators for the data members A Virtual print function that displays the ship’s name and the year it was built CruiseShip (include CuriseShip.h and CruiseShip.cpp) class that is derived from the Ship class. Contains data members for the following Integer for the maximum number of passengers Constructor Accessor and mutator for the data member A print function that overrides the print function in the base class. This print function should display only the ship’s name and the maximum number of passengers. CargoShip (include CargoShip.h and CargpShip.cpp) class that is derived from Ship class. Contains data members for the following Integer for the cargo capacity in tonnage Constructor Accessor and mutator for the data member A print function that overrides the print function in the base class. This print function should display only the ship’s name and the cargo capacity. Main should create an array of Ship pointers. The array should be able to hold six elements. The array elements should be initialized with the addresses of dynamically allocated Ship, CruiseShip, and CargoShip objects. The program should then have two methods that is passed the array of Ship pointers (the array), one method will iterate thru the array calling the print method. The other method will determine which ship is older. The array should have two instances of each of the classes.



Radioactive Tutors

Radio Active Tutors is a freelance academic writing assistance company. We provide our assistance to the numerous clients looking for a professional writing service.

NEED A CUSTOMIZE PAPER ON THE ABOVE DETAILS?
Order Now


OR

Get outline(Guide) for this assignment at only $10

Get Outline $10

**Outline takes 30 min - 2 hrs depending on the complexity and size of the task
Designed and developed by Brian Mubichi (mubix)
WhatsApp