Ask Question
10 December, 17:20

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

Class Cat

{

int GetAge () const;

private:

int itsAge;

};

+2
Answers (1)
  1. 10 December, 17:42
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers