reellearning

User Defined Type - VPetApp.cpp

Jun 4th, 2012
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. /*
  2.  * VPetApp.cpp
  3.  *
  4.  *  Created on: Aug 10, 2011
  5.  *      Author: Derek
  6.  */
  7.  
  8. #include "VPet.h"
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     VPet bob(150, false);
  14.     bob.feedPet(25);
  15.  
  16.     VPet sam;
  17.     sam.feedPet(10);
  18.  
  19.     cout << "Bob weighs: " << bob.getWeight() << endl;
  20.     cout << "Sam weighs: " << sam.getWeight() << endl;
  21.  
  22.     if(bob.getHungry())
  23.     {
  24.         cout << "Bob is hungry." << endl;
  25.     }
  26.     else
  27.     {
  28.         cout << "Bob is not hungry." << endl;
  29.     }
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment