// PL4/class4.cpp // An example using a class // Niels Walet, last updated 04/12/2019 #include #include #include class particle { private: std::string type {"Ghost"}; double mass {0.0}; double momentum {0.0}; double energy {0.0}; public: // Default constructor particle() = default ; // Parameterized constructor particle(std::string particle_type, double particle_mass, double particle_momentum) : type{particle_type}, mass{particle_mass}, momentum{particle_momentum}, energy{sqrt(mass*mass+momentum*momentum)} {} ~particle(){std::cout<<"Destroying "<