Hey guys,
I was just reading again about classes and their functions and i made some code, the thing i want to do is have a function, eg.
void Cat::Sleep()
and have it to have three cout's and choose one of them to say at random,
Heres my code.
#include <iostream>
#include <conio.h>
using namespace std;
class Cat
{
public:
unsigned int age;
unsigned int weight;
void Meow();
void Feed();
void Sleep();
};
void Cat::Meow()
{
cout << "Meow" << endl;
}
void Cat::Feed()
{
cout << "Meoww (Cat's Happy To Eat)" << endl;
cout << "Psshhh (Cat Is Not Hungry!)" << endl;
cout << "Zzz (The Cat's Asleep, Leave It Alone)" << endl;
}
void Cat::Sleep()
{
cout << "Meowww Zzz (Cat Has Fallen Asleep)" << endl;
cout << "Psshhh (The Cat Is Not Tired)" << endl;
cout << "Zzz (The Cat Is Already Asleep)" << endl;
}
int main()
{
Cat BlackMagic;
BlackMagic.Feed();
BlackMagic.Sleep();
getch();
}