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 virtual print function...


c++ oop


Design a Ship class that has the following members:<br>A member variable for the name of the ship (a string)<br>A member variable for the year that the ship was built (a string)<br>A virtual print function that displays the ship's name and the year it was built.<br>Design a CruiseShip class that is derived from the Ship class. The CruiseShip class should<br>have the following members:<br>A member variable for the maximum number of passengers (an int)<br>A print function that overrides the print function in the base class. The CruiseShip<br>class's<br>print function should display only the ship's name and the maximum number of<br>passengers.<br>

Extracted text: 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 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 print 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.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here