CODE
#include <iostream.h>
class cat
{
public:
cat (int a)
~cat
int age;
int status;
void meow();
void sleep();
void wake();
void fight();
};
void cat::meow()
{
if (status==1)
{
cout<<"zzzzz...\n"<<endl;
}
else
{
cout<<" meow!!!!...\n"<<endl;
}
}
void cat::sleep()
{
if (status==1)
{
cout<<" zzzz......\n"<<endl;
}
else
{
cout<< " good night! zzzzz....!\n "<<endl;
status=1;
}
}
void cat::wake()
{
if (status==0)
{
cout<< " hi! nice to see you \n "<<endl;
}
else
{
cout<<" aaaaaaah.... Good morning! \n "<<endl;
status=0;
}
}
int main()
{
cat frisky;
int what=0;
frisky.wake();
cout<<" Hello! how old is your cat?";
cin>>frisky.age;
cout<<" thank you! \n "<<endl;
cout<<" press 1 to meow, 2 to sleep, 3 to wake, 4 to end"<<endl;
cin>>what;
while (what!=4)
{
if (what==1)
{
frisky.meow();
}
else if (what==2)
{
frisky.sleep();
}
else if (what==3)
{
frisky.wake();
}
cin>>what;
}
{
cout<<endl;
cout<<" meow! bye all "<<endl;
what==6
}
return 0;
}
what i wrong with this i have an error in line 7 that says illegal type
can you please help me???!!!
This post has been edited by jvosa: 16 May, 2008 - 04:37 AM