All pastes #838375 Raw Edit

Mine

public text v1 · immutable
#838375 ·published 2007-12-30 09:12 UTC
rendered paste body
#include <iostream>
#include <string>
#include <time.h>

using namespace std;

class Pet {
public:
	Pet(string name = "Feeks", int hunger = 100, int boredom = 100);	
	void Talk();
	void Eat(int food = 4);
	void Play(int fun = 4);

private:
	int m_hunger;
	int m_boredom;
	string m_name;

	int GetMood() const;
	void PassTime();
};

Pet::Pet(std::string name, int hunger, int boredom) {
	m_hunger = hunger;
	m_boredom = boredom;
	m_name = name;
	time_t seconds;
	seconds = time (NULL);
	Talk();
}


void newPet() {
	string name;
	string type;
	cout << "Welcome to Pet Designer!\n\nPlease enter a name for your pet: ";
	cin >> name;
	cout << "Please enter the type of your pet: ";
	cin >> type;
	Pet myPet(name, 100, 100);
}

void Pet::Talk() {
	int mood;
	mood = GetMood();
	cout << "Hi. I'm " << m_name << ". My mood is at level " << mood << ".\n";
}

inline int Pet::GetMood() const {
	return ((m_hunger + m_boredom) / 2);
}

int main() {
	newPet();
	myPet.Talk();
	system("pause");
}