reellearning

Overloaded Insertion Operator - VPet.h

Jun 4th, 2012
578
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. /*
  2.  * VPet.h
  3.  *
  4.  *  Created on: Jun 4, 2012
  5.  *      Author: Derek
  6.  */
  7.  
  8. #ifndef VPET_H_
  9. #define VPET_H_
  10.  
  11. #include <iostream>
  12.  
  13. class VPet
  14. {
  15.     public:
  16.  
  17.         friend std::ostream& operator<<(std::ostream& os, const VPet& vp);
  18.  
  19.         // Constructors (Member function)
  20.         VPet(double, bool);
  21.         VPet();
  22.  
  23.         // Member functions
  24.         void feedPet(int amount);
  25.         bool getHungry() const;
  26.         double getWeight() const;
  27.  
  28.     private:
  29.  
  30.         // Data Members
  31.         double weight;
  32.         bool hungry;
  33. };
  34.  
  35. #endif /* VPET_H_ */
Advertisement
Add Comment
Please, Sign In to add comment