#include <iostream>
#include <string>
using namespace std;
class ScoreBoard {
public:
string team;
int score;
ScoreBoard(string t) : team(t), score(0) {}
void shot(int point) {
if (point == 2) score += 2;
else if (point == 3) score += 3;
}
};
int main() {
ScoreBoard sb("Lakers");
sb.shot(2);
sb.shot(2);
sb.shot(3);
cout << sb.score << endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: