Answer:
Following are the statement in the C++ Programming Language.
//check condition that score1 is greater than score2
if (score1 > score2)
{//print the message and brake line
cout << "player1 wins" << endl;
//increment in the variable by 1
++player1Wins;
//increment in the variable by 1
++player2Losses;
}
//check condition when score2 is greater than score1
else if (score2 > score1)
{
//print the message and brake line
cout << "player2 wins" << endl;
//increment in the variable by 1
++player2Wins;
//increment in the variable by 1
++player1Losses;
}
//otherwise
else
{
//print the message and brake line
cout << "tie" << endl;
//increment in the variable by 1
++tieCount;
}
Explanation:
<u>Following are the description of the program</u>.
- In the statement, we check that the variable 'score1' is greater than 'score2' then, print message and brake line, then increment in the variables by 1 that is 'player1Wins' and 'player2Losses'.
- Again check that the variable 'score2' is greater than 'score1' then, print message and brake line, then increment in the variables by 1 that is 'player2Wins' and 'player1Losses'.
- Otherwise, print the following message and break line then, increment in the variable 'tieCount'