Question: e to derive new classes; 2) Understand abstract base classes; 3) Overload base dlass functions; 4) Override base dass virtual functions; 5) Define pure virtual
e to derive new classes; 2) Understand abstract base classes; 3) Overload base dlass functions; 4) Override base dass virtual functions; 5) Define pure virtual functions; 6) Understand static and dynamic function call binding:7) Use custom destructors to free dynamically all Project description: In this assignment cdass, a CargoShip class and a CruiseShip and C++ implementation details of inheritance and polymorphism. you will create a dass representing a ship, and create two additional classes that inherit from the Ship class. The project is geared to give you practical experience with characteristics Requirements: 1. Your program must be split into 7 files. There will be 3 classes (each with separate interface and implementation files), and a driver file. The requirements for these are specified below a) The Ship class-This is an abstract dass . Files must be named ship.h and ship.cpp e Class must be named Ship Must contain #include guards for SHIP-H Will have these protected members A string containing the ship's name A double representing the amount of fuel on board (in tons) i. . . Must have these public members A two parameter constructor that takes the ship's name and fuel load (in that order) Avoid function, fuel, that outputs the ship's name and its fuel load (see sample output) A virtual void function, sail, that prints a generic message indicating that the ship is underway A pure-virtual void function, lood, that loads the ship with tonnage (cargo) or passengers (cruise) l. . iv. b) The CruiseShip class-This is a derived class that inherits from the Ship class as public Files must be named cruiseship.h and cruiseship.cpp Class must be named CruiseShip Must contain sinclude guards for CRUISESHIP Will have these private members . i. Three doubles that indicate the percentage of passengers in Luxury, Upper Deck, and Lower Deck cabins respectively. These values must sum to 1 i. Three integers that indicate the number of passengers in Luxury, Upper Deck, and Lower Deck cabins respectively Must have these public members
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
