Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. class Apple : Fruit
  2. {
  3.     private:
  4.         bool red;
  5.     public:
  6.         Apple()
  7.         {
  8.             red = true;
  9.         }
  10.  
  11.         Apple(bool red)
  12.         {
  13.             this->red = red;
  14.         }
  15.  
  16.         void eat()
  17.         {
  18.             setSeeds(getSeeds() - 10);
  19.         }
  20.  
  21.         bool getRed() { return red; }
  22.  
  23.         void setRed(bool red) { this->red = red; }
  24.        
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement