#include <iostream>
using namespace std; // consider removing this line in serious projects
class Game{
private:
int goals;
public:
Game();
int getGoals();
void incrementGoals();
};
void Game::incrementGoals(){
goals++;
}
Game::Game(){
goals = 0;
}
int Game::getGoals(){
return goals;
}
int main() {
Game football;
cout << "Number of goals at start: " << football.getGoals() << endl;
football.incrementGoals();
football.incrementGoals();
cout << "GAME... Final score" << football.getGoals() << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOyAvLyBjb25zaWRlciByZW1vdmluZyB0aGlzIGxpbmUgaW4gc2VyaW91cyBwcm9qZWN0cwoKY2xhc3MgR2FtZXsKCXByaXZhdGU6CgkJaW50IGdvYWxzOwoKCXB1YmxpYzoKCQlHYW1lKCk7CgkJaW50IGdldEdvYWxzKCk7CgkJdm9pZCBpbmNyZW1lbnRHb2FscygpOwp9OwoKdm9pZCBHYW1lOjppbmNyZW1lbnRHb2FscygpewoJZ29hbHMrKzsKfQoKR2FtZTo6R2FtZSgpewoJZ29hbHMgPSAwOwp9CgppbnQgR2FtZTo6Z2V0R29hbHMoKXsKCXJldHVybiBnb2FsczsKfQoKaW50IG1haW4oKSB7CglHYW1lIGZvb3RiYWxsOwoJCgljb3V0IDw8ICJOdW1iZXIgb2YgZ29hbHMgYXQgc3RhcnQ6ICIgPDwgZm9vdGJhbGwuZ2V0R29hbHMoKSA8PCBlbmRsOwoJCglmb290YmFsbC5pbmNyZW1lbnRHb2FscygpOwoJZm9vdGJhbGwuaW5jcmVtZW50R29hbHMoKTsKCQoJY291dCA8PCAiR0FNRS4uLiBGaW5hbCBzY29yZSIgPDwgZm9vdGJhbGwuZ2V0R29hbHMoKSA8PCBlbmRsOwoJCn0=