Use a member initialization list to make the GamePoints' constructor assign teamWhales with 100 and teamWolves with 100.
#include using namespace std;class GamePoints { public: GamePoints(); void Start() const; private: int teamWhales; int teamWolves;};GamePoints::GamePoints() :/* Your code goes here */{}void GamePoints::Start() const { cout < "game="" started:="" whales="" "="">< teamwhales="">< "="" -="" "="">< teamwolves="">< "="" wolves"=""><>}int main() { GamePoints myGame; myGame.Start(); return 0;}
class GamePoints { public: GamePoints(); void Start() const;
private: int teamWhales; int teamWolves;};
GamePoints::GamePoints() :/* Your code goes here */{}
void GamePoints::Start() const { cout < "game="" started:="" whales="" "="">< teamwhales="">< "="" -="" "="">< teamwolves="">< "="" wolves"=""><>}
int main() { GamePoints myGame;
myGame.Start();
return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here