class Pet { public: Pet(std::string name, int age) : m_name(name), m_age(age) {} std::string getName() const { return m_name; } int getAge() const { return m_age; } private: std::string m_name; int m_age; };
int main() { Pet myPet("Fluffy", 3); std::cout << "My pet's name is " << myPet.getName() << " and it is " << myPet.getAge() << " years old." << std::endl; return 0; }This code creates a new `Pet` object with the name "Fluffy" and age 3, and then prints out a message that includes the pet's name and age. The Pet class does not belong to any specific package or library, as it is a simple class that can be defined and used in any C++ program.