Question: Write a program to accomplish chapter 15 - Programming Challenge #12 Ship, Cruiseship and cargoship classes each element in the grades array d display the
each element in the grades array d display the numeric scores monstrate the class in a program 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) It (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. n a CruiseShip class that is derived from the Ship class.1 should have the following members: A member variable for the maximum number of passengers (a n int) constructor and appropriate accessors and mutators ship A print function that overrides the print function in the base class. The Cruise class's print function should display only the ship's name a of passengers. Design a CargoShip class that is derived from the Ship class. The Cargo should have the following members: ship class . A member variable for the cargo capacity in tonnage (an int) .A constructor and appropriate accessors and mutators . A print function that overrides the print function in the base class. The Cargoship 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
