// PL7/galaxy_wrong1.cpp // The definition of a galaxy on top of the celestial object class // Niels Walet, last updated 06/01/2022 #include #include using namespace std; class celestial_object { private: string name; double mass; double distance; double luminosity; public: celestial_object() : name{"no-name"}, mass{}, distance{}, luminosity{} {} celestial_object(const string nm, const double l, const double m, const double d) : name{nm}, mass{m}, distance{d}, luminosity{l}{} ~celestial_object(){} string name() {return name;} friend ostream& operator<<(ostream& , const celestial_object& ); }; class galaxy: public celestial_object { private: string hubble_type; long stars; public: galaxy() : name{"no-name"}, luminosity{}, mass{}, distance{}, hubble_type{"Sc"}, stars{} {} galaxy(const string nm, const double l, const double m, const double d, const string ht, const long nst) : name{nm}, luminosity{l}, mass{m}, distance{d}, hubble_type{ht}, stars{nst} {} ~galaxy(){} friend ostream& operator<<(ostream& , const galaxy& ); } ostream& operator<<(ostream& o, const galaxy& gx) {o <<" galaxy "<