Ask Question
2 September, 11:55

What methods would you add to make this class declarationvery useful?

Class Cat

{

int GetAge () const;

private:

int itsAge;

};

+5
Answers (1)
  1. 2 September, 12:22
    0
    void SetAge (int age), void meow ()

    Explanation:

    Since the class has an itsAge variable as private and has a GetAge () method. There should be a SetAge () method to set the value of the age.

    Also, since it is a Cat class, it is better to have a method that mimics the voice of the cat, meow ()
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What methods would you add to make this class declarationvery useful? Class Cat { int GetAge () const; private: int itsAge; }; ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers