#ifndef SHIP_H #define SHIP_H #include class Ship { public: Ship(std::string const& n, int w); virtual ~Ship() = default; std::string print_string() const; virtual unsigned int get_power() const = 0; protected: std::string name; int weight; }; class WarShip : public Ship { public: WarShip(std::string const& n, int w, int g); unsigned int get_power() const override; private: int guns; }; class CargoShip : public Ship { public: CargoShip(std::string const& n, int w, int c); unsigned int get_power() const override; private: int cargoCapacity; }; #endif