Question: ++ Design a ShipClass class has the following members: A member variable for the name of the ship (a string) A member variable for the
++
Design a ShipClass class has the following members:
A member variable for the name of the ship (a string)
A member variable for the year the ship was built (make it a string too)
A constructor and appropriate getter and setter methods
A virtual print method that displays the ships name and year built
Design a CruiseShip class that is derived from the ShipClass that has:
A member variable for the maximum number of passengers (an int)
A constructor and appropriate getter and setter methods
A print method that displays the ships name and maximum number of
passengers
Design a CargoShip class that is derived from the ShipClass that has:
A member variable for the cargo capacity (an int)
A constructor and appropriate getter and setter methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
