I am supposed to read in data from a file and store it. I know how to read from a file and display it, in main, what i don't understand is how to do that with classes and objects. This is the part im having a little trouble with and would appreciate any advice on how to go about figuring this out. Obviously this is an assignment and i am not asking for "answer code" but advice.
Create the Game class. Each instance of Game should store all data of a particular game (playerOne, playerTwo, playerOneScore, playerTwoScore, roundOf). For example, in Ohio State's first game of the 2011 NCAA Tournament, this information would be:
playerOne: "Ohio State"
playerTwo: "Texas-San Antonio"
playerOneScore: 75
playerTwoScore: 46
roundOf: 64
I am creating a Game.h file and Game.cpp file here is the Game.h file. if you have any advice on something i should add or take out that would be appreciated. this program is being written from scratch.
class Game
{
// default constructor
Game();
public:
string player_One;
string player_Two;
double player_One_Score;
double player_Two_Score;
bool fillGame(ifstream & din);
int round_Of;
void Margin_Of_Victory;
void print;
};
#endif /* GAME_H */