In general, your Class Methods shouldn't be doing interactive I/O. By interactive, @laserlight means you shouldn't be having things like "Enter Lucy's age: " in your method that does I/O. It takes a lot to take understand the "why" because you are indeed learning one of the hardest languages out there for beginners. You'll gradually understand with time the "why" when you start reading about data abstraction etc. For now, you needn't worry about it and should just care about getting things to work and be able to understand them.
Make your I/O methods un-interactive. Do the interaction handling separately. Also, you'd probably want the Dog class for different dogs too and not just Lucy. The tutorial explains very well on how to do just that. Also, if seeing things like const written everywhere makes it confusing, you can probably ignore that for now. It's just present so that your methods are valid for const objects too.
Your code should be more like:
Code:
void SetAge ()
{
cin >> Age; // You actually need to check here if the user entered a number and not characters but don't worry about that for now
}
int GetAge () const
{
return Age;
}
And your interaction should be more like:
Code:
cout << "Enter " << dog.GetName () << " 's age: "; dog.SetAge ();
// Assuming "dog" is an instance/object of your Dog class and GetName has been properly defined the way it should be and assuming the name of the dog has been entered already before filling in the age