Question: 12. ship, CruiseShip, and cargoship Classes Design a Ship class that has the following members: A member variable for the name of the ship (a



12. ship, CruiseShip, and cargoship Classes Design a Ship class that has the following members: A member variable for the name of the ship (a string) A member variable for the year that the ship was built (a string) A constructor and appropriate accessors and mutators A virtual print function that displays the ship's name and the year it was built. Design a Cruiseship class that is derived from the Ship class. The cruiseship class should have the following members A member variable for the maximum number of passengers (an int) A constructor and appropriate accessors and mutators Aprint function that overrides the print function in the base class. The Cruiseship class's print function should display only the ship's name and the maximum number of passengers. . Design a cargoship class that is derived from the Ship class. The cargoship class should have the following members . A member variable for the cargo capacity in tonnage (an int) . A print function that overrides the print function in the base class. The cargoship A constructor and appropriate accessors and mutators. class's print function should display only the ship's name and the ship's cargo capacity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
