Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class Animals
{
public:
std::string hungry;
std::string tired;
std::string happy;
std::string name;
Animals( std::string _name, std::string _hungry, std::string _tired, std::string _happy ) : name(_name), hungry(_hungry), tired(_tired), happy(_happy) {}
void normal() const
{
cout << "ASCII" << endl;
}
void play() const
{
cout << "ASCII" << endl;
}
void relax() const
{
cout << "ASCII" << endl;
}
};
class Cat : public Animals
{
public:
Cat(std::string _name) : Animals(_name, "meoowwww, I'm starving", "I think its sleepy cat time....", "This is purrrrrfect!") {}
void normal () const
{
system("cls");
ifstream f("normalCat.txt");
if (f.is_open())
cout << f.rdbuf();
}
void play() const
{
system("cls");
ifstream f("playCat.txt");
if (f.is_open())
cout << f.rdbuf();
}
void relax() const
{
system("cls");
ifstream f("relaxedCat.txt");
if (f.is_open())
cout << f.rdbuf();
}
};
class Dog : public Animals
{
public:
Dog(std::string _name) : Animals(_name, "is it dinner time??", "rweeeeeepyy", "WUF, wuf, Wonderful!!") {}
void normal () const
{
system("cls");
ifstream f("normalDog.txt");
if (f.is_open())
cout << f.rdbuf();
}
void play() const
{
system("cls");
ifstream f("playDog.txt");
if (f.is_open())
cout << f.rdbuf();
}
void relax() const
{
system("cls");
ifstream f("relaxedDog.txt");
if (f.is_open())
cout << f.rdbuf();
}
};
int main()
{
Dog e("Tolly");
e.normal();
return 0;
}