// PL4/class1.cpp // An example using a class // Niels Walet, last updated 04/12/2019 #include #include #include class particle { public: std::string type; double mass; double momentum; double energy; }; void print_data(const struct particle &p) { std::cout.precision(3); // 2 significant figures std::cout<<"Particle: [type,m,p,E] = ["<