Question: design a program that will allow a user to keep...
Design a program that will allow a user to keep track
of the status of a soccer game. You will design a SoccerGame class
that will represent the state of the soccer game.
Its attributes are:
The name of the first team
The name of the second team
The score of the first team
The score of the second team
The status of the game (finished or in
The constructor will pass in two team names and will
create a SoccerGame object where the score of each team is 0 and
the status of the game is in progress.
The methods for the SoccerGame
Record a goal scored (add one to the team
Change status of the game as finished
Return the score of a team
Return the name of the team that is currently winning
or has won the game
You will design a test class that
allows the user to instantiate a SoccerGame object for a current
The user will enter the names of
two teams and the program will start a soccerGame object. Then the
program will allow the user to update the object as needed until
the game ends.
The program will loop and allow the
score to be updated each time a team scores a goal until the game
has finished. At that time, the user will get the score of each
team and then get the name of the team that has won the
The program will also change the
status of the game to finished.
Provide two test cases, presenting the inputs and required outputs for each case, and the resulting action of the program.