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 <iostream>
#include <vector>
#include <string>
#include "display.h"
#include "Stats.h"
using namespace std;
string output;
//This code shouldn't be used in end product, just used to show how you can incorporated display.h and Stats.h
//into the main body of code
int main()
{
Stats firstPet("Buddy");
firstPet.inc_Hunger(-51, true);
firstPet.inc_Happiness(-60, false);
firstPet.inc_Health(-70, true);
Stats secondPet("Garfield");
vector<string> options = {"Food", "Shop", "Games", "Save", "Exit"};
string output = Display(options);
cout << "\n" << endl;
if(output == "Food")
{
cout << "I'm hungry!" << endl;
firstPet.inc_Hunger(10, false);
}
else if(output == "Shop")
{
cout << "We're closed at the moment!!" << endl;
}
else if(output == "Games")
{
cout << "Let's go play football!" << endl;
}
else if(output == "Save")
{
firstPet.Save();
secondPet.Save();
firstPet.getSave();
secondPet.getSave();
}
else if(output == "Exit")
{
cout << "Bye!!" << endl;
}
else
cout << "unable to distinguish what you've said!" << endl;
cout << "\n" << endl;
return 0;
}