Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Vpet.cpp
- *
- * Created on: Aug 10, 2011
- * Author: Derek
- */
- #include "VPet.h"
- VPet::VPet(double w, bool hun):weight(w),hungry(hun)
- {
- }
- VPet::VPet():weight(100),hungry(true)
- {
- }
- void VPet::feedPet(int amt)
- {
- if(amt >= weight * 0.5)
- {
- hungry = false;
- }
- else
- {
- hungry = true;
- }
- weight = weight + 0.25 * amt;
- }
- double VPet::getWeight() const
- {
- return weight;
- }
- bool VPet::getHungry() const
- {
- return hungry;
- }
Advertisement
Add Comment
Please, Sign In to add comment