All pastes #838380 Raw Edit

Mine

public cpp v1 · immutable
#838380 ·published 2007-12-30 09:27 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();}bool newPet(Pet* pet) {	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 = Pet(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");}