Reference no: EM132382406
Question
A basketball game has four quarters. You need a program to do the following. Use a for loop to input scores of team A and team B in each of the four quarters. Every time a score is entered, update and display the current total score of that team. After all four quarters, compare the total scores of the two teams and display the outcome of the game ("Team A has won", "Team B has won" or "It is a tie")
The following is an example.
Enter team A score in this quarter: 22
Team A score so far: 22
Enter team B score in this quarter: 24
Team B score so far: 24
Enter team A score in this quarter: 19
Team A score so far: 41
Enter team B score in this quarter: 26
Team B score so far: 50
Enter team A score in this quarter: 25
Team A score so far: 66
Enter team B score in this quarter: 22
Team B score so far: 72
Enter team A score in this quarter: 21
Team A score so far: 87
Enter team B score in this quarter: 20
Team B score so far: 92
Team B has won