fork download
#include 
#include 

using namespace std;


class Cat{
    private :
        string m_name;
        string m_owner;
        int m_price;
        string m_color;
        double m_weight;
        void sellCat(string whoBought,int price);
    public :
        Cat(); //this is the default constructor notice no arguments
        Cat(const string name , const string color, int price, double weight, const string owner);
        void changeColor(string newColor);
        void setName(string name);
        void showCat();
};


Cat::Cat(const string name , const string color, int price = 0 , double weight = 0, const string owner = "NotSoldYet"){
    m_name = name;
    m_owner = owner;
    m_color = color;
    m_price = price ;
    m_weight = weight;
}

void Cat::showCat()
{
  cout << "Name is " << m_name << endl << "Owner is " << m_owner;
  
}



int main()
{
  Cat newCat("Garfield","Green"); 
  newCat.showCat();
  
}
Success #stdin #stdout 0.02s 2860KB
stdin
Standard input is empty
stdout
Name is Garfield
Owner is NotSoldYet