// PL4/struct.cpp // An example using a struct as a class // Niels Walet, last updated 04/12/2019 #include #include #include struct particle { 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] = ["<