Help! Topic: inheritance, derived classes in C++. CAN someone explain the error" calling a private constructor, has_abs is priv
#include <iostream> #include <cstring> using namespace std; class Vehicle { public: std::string name() { return name_; } int number_of_wheels() { return number_ofwheels; } std::string propulsion_type() { return propulsiontype; } double max_speed() { return maxspeed; } protected: Vehicle(const std::string &name, int number_of_wheels, const std::string &propulsion_type, double maxspeed) : name(name), number_ofwheels(number_of_wheels), propulsiontype(propulsion_type), maxspeed(maxspeed) {} std::string name; int number_ofwheels; std::string propulsiontype; double maxspeed; }; class Bike : public Vehicle { public: Bike() : Vehicle("Bike", 2, "Muscles", 30) {} }; class Plane : public Vehicle { Plane(const std::string &name, const std::string &propulsion_type, double max_speed, bool has_abs) : Vehicle(name, 4, propulsion_type, max_speed), hasabs(has_abs) {} bool has_abs() { return hasabs; } private