create a class that will implement the CreateGame interface. This class will simulate a game played between two teams. The simulation will run in a class called PlayBall.
- Implement the CreatePlayer Interface
- Extend the Team Abstract Class
- Implement the CreateGame Interface
- Run the game
- Show the current score while game is played after each inning.
- Show the final score when the game ends.
- Determine the winner and print the winner’s name and final score
Given files:
public abstract class Team {
public final int rosterCount = 9;
public abstract void setTeamName(String name);
public abstract String getTeamName();
public abstract void setTeamCity(String city);
public abstract String getTeamCity();
public int getRoster(){
return rosterCount;
}
}
public interface CreateGame {
public abstract void runGame();
//should run the game as a simulation that automatically plays the whole game until end of 9 innings.
public abstract String printAfterInning();
//should print score for each team after each inning
public abstract String printWinnerAfterGame();
//should print the winner and final score after game completed
}
public interface CreatePlayer {
public abstract void setPlayerName(String name);
public abstract String getPlayerName();
public abstract void setPlayerPosition(String position);
public abstract String getPlayerPosition();
public abstract void setPlayerAge(int age);
public abstract int getPlayerAge();
Previous answers to this question
This is a preview of an assignment submitted on our website by a student. If you need help with this question or any assignment help, click on the order button below and get started. We guarantee authentic, quality, 100% plagiarism free work or your money back.
Get The Answer Java Project
create a class that will implement the CreateGame interface. This class will simulate a game played between two teams. The simulation will run in a class called PlayBall.
- Implement the CreatePlayer Interface
- Extend the Team Abstract Class
- Implement the CreateGame Interface
- Run the game
- Show the current score while game is played after each inning.
- Show the final score when the game ends.
- Determine the winner and print the winner’s name and final score
Given files:
public abstract class Team {
public final int rosterCount = 9;
public abstract void setTeamName(String name);
public abstract String getTeamName();
public abstract void setTeamCity(String city);
public abstract String getTeamCity();
public int getRoster(){
return rosterCount;
}
}
public interface CreateGame {
public abstract void runGame();
//should run the game as a simulation that automatically plays the whole game until end of 9 innings.
public abstract String printAfterInning();
//should print score for each team after each inning
public abstract String printWinnerAfterGame();
//should print the winner and final score after game completed
}
public interface CreatePlayer {
public abstract void setPlayerName(String name);
public abstract String getPlayerName();
public abstract void setPlayerPosition(String position);
public abstract String getPlayerPosition();
public abstract void setPlayerAge(int age);
public abstract int getPlayerAge();
Previous answers to this question
This is a preview of an assignment submitted on our website by a student. If you need help with this question or any assignment help, click on the order button below and get started. We guarantee authentic, quality, 100% plagiarism free work or your money back.
Get The Answer