This is what i have for code this far, i need help trying to keep score here. Any help would be well appreciated thanks

int sum = 0, teamScore, numPoints, score1 = 0, score2 = 0;

while (teamScore != -999)
{
cout << "Did team 1 or team 2 score? (Enter 1, 2 or -999 to quit): ";
cin >> teamScore;
cout << "How many points did they score? (1, 2, or 3): ";
cin >> numPoints;

if (teamScore ==1 && teamScore != -999)
{
cout << "Team 1" << score1 = sum + numPoints;
cout << "Team 2" << score2 = sum + numPoints;
}
else if (teamScore ==2 && teamScore != -999)
{
cout << "Team 1" << score1 = sum + numPoints;
cout << "Team 2" << score2 = sum + numPoints;
}

Edited 6 Years Ago by WaltP: Added CODE tags -- with all the help about them, how could you miss using them????

if (teamScore ==1 && teamScore != -999) If team = 1 it can't be -999. Simplify both if statements

cout << "Team 1" << score1 = sum + numPoints;
cout << "Team 2" << score2 = sum + numPoints;

Did they both score the points? Once the output is done, what's the value of sum ? Is sum important?

This question has already been answered. Start a new discussion instead.