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.
and use din instead of readarrayFile. Also, replace stored with round_Of and other member variables. However, I recommend that you do the strings last - they may be a little tricky (requiring delimiters, etc...).
and a temp.cpp with correct methods for converting and returning the correct output with a print
and in main.cpp i would ask for input and then call it with a temp object.
1 2 3 4 5 6 7 8 9 10 11
Temp input;
//asks user for input
cout << "Please enter a temperature in degrees Celsius" << endl;
cout << "Temp in degrees: ";
cin >> userInput;
// outputs what the user input
input.setCelsius(userInput);
input.print();