I'm currently teaching myself the fundamentals of C++ programming from a book and am building a program to use all that I've read up to and including the classes chapter. It's sort of a tamagotchi-like program where you're given a cat and have to interact with it. Fairly basic. I have a reputation system in place to determine the end of the game (if the cat doesn't like you because you pet it too much or didn't feed it, it will run away). I have a variable MAXPET which increments as you interact. When it reaches 10, it calls to Scratch() which increments from there on the variable hatePLUS. What i need it do to is reset after a timeframe or upon the selection of a new interaction, but not quite sure how to do that yet. Any help would be appreciated.


Source main.cpp:

Code:
#include <iostream>
#include "cat.h"
using namespace std;

void MenuFunction(int &MAXPET, int &lovePLUS, int &hatePLUS);

Cat Frisky;

int main()
{
    int itsAGE;
    int lovePLUS = 0;
    int hatePLUS = 0;
    int MAXPET;

    cout << "Meet Frisky. He is " << Frisky.GetAge() << " years old." << endl << endl;
    Frisky.Purr(++lovePLUS);
    Frisky.SetLOVEHATE(lovePLUS, hatePLUS);

    cin.get();

    MenuFunction(MAXPET, lovePLUS, hatePLUS);


    return 0;
}

void MenuFunction(int &MAXPET, int &lovePLUS, int &hatePLUS) {
    int choice;

    for (choice =0; choice < 4; choice = 0) {

    cout << "MAXPET: " << MAXPET << " lovePLUS: " << lovePLUS << " hatePLUS: " << hatePLUS << endl << endl;

    cout << "***** Interact with Frisky! *****" << endl << endl;
    cout << "[1] - Pet Frisky!\n[2] - Play with Frisky!\n[3] - Feed Frisky!" << endl << endl;
    cin  >> choice;

        switch(choice) {
            case 1:
            Frisky.Pet(++MAXPET, lovePLUS, hatePLUS);
            break;
        }
    }
}
Source cat.h:

Code:
#ifndef CAT_H_INCLUDED
#define CAT_H_INCLUDED
using namespace std;

class Cat {
public:
// Constructor and Destructor
     Cat();
    ~Cat() {}
// Public Functions
    void Meow()const { cout << "Meow!" << endl; }
    void Play();
    void Pet(int &MAXPET, int &lovePLUS, int &hatePLUS);
    int  Scratch(int &hatePLUS);
    void Purr(int &lovePLUS);
    void Eat();
    void Drink();
// Accessor Functions
    int  GetAge()const                             { return AGE; }
    void SetAge(int itsAGE)                        { AGE = itsAGE; }
    void SetLOVEHATE(int &lovePLUS, int &hatePLUS)  { LOVE = lovePLUS; HATE = hatePLUS; };
    void SetREPUTATION()                           { REPUTATION = LOVE - HATE + 5; }
    int  GetREPUTATION()                           { return REPUTATION; }
    int  GetLOVE()                                 { return LOVE; }
    int  GetHATE()                                 { return HATE; }

private:
// Member variables (private)
    int AGE;
    int LOVE;
    int HATE;
    int REPUTATION;
    int MAXPET;
};

// Constructor definition
Cat::Cat() {
    AGE  = 1;
}

void Cat::Purr(int &lovePLUS) {

        cout << "Frisky purrs!" << endl << endl;
}

void Cat::Pet(int &MAXPET, int &lovePLUS, int &hatePLUS) {
    if (MAXPET < 10) {
        Cat::Purr(++lovePLUS);
    }
    else
        Cat::Scratch(++hatePLUS);
}

int Cat::Scratch(int &hatePLUS) {
    cout << "Frisky is mad! You've been scratched." << endl <<endl;
    return hatePLUS;
}

#endif // CAT_H_INCLUDED