Ghostwriting simulated football World Cup games, ghostwriting java programs, ghostwriting Player classes

Write a simulated soccer World Cup match, write a java program, and write a Player class
For this task, you will simulate a soccer World Cup match. This is a simplification of the actual FIFA World Cup without any knowledge of the rules of football.
This program has only a text interface and does not require a GUI. More points will be awarded for games that are easy to follow with clear information/error messages.
The Football World Cup is played between 4 teams. Teams are ranked from 1 to 4, with 1 showing the highest ranking and the lowest 4. The cup is divided into two stages: preliminary and final.
In the preliminaries, each team plays against three other teams (a total of six games). Games in the preliminaries will be played in order, and the results of each game will be displayed on the screen when the game is over. In the preliminaries, the team accumulated 3 points to indicate victory, 1 point is a tie, and 0 points are eliminated.
At the end of the preliminary stage, the system will display the final result:
ranking according to the following criteria:
1. The ranking is based on the number of points from the highest to the lowest;
2. If the two teams have the same score, the team with the most goals will be ranked first.
3. If the two teams cannot be ranked by any criteria, then randomly decide which team comes first.


After the preliminaries, the top two teams will enter the final (the winner must be decided, there is no possibility of a tie).
After the final, the results will be displayed on the screen, including the name of the winning team, the Golden Boot winner and the team with the Fair Play Award .

Your design should include at least three classes: 1. player: 2. Team; 3. Game.
A better solution could include more classes, including for example Menu and RandomGoalsGenerator. For every class there should be a default constructor and a constructor that accepts the values ​​of these fields as parameters.


Player:
An object of Player will contain at least the following fields:
name: Type string, the name can contain only alphabetic characters and at most one hyphen '-', to accommodate names that may be hyphenated, such as Zeta-Jones. There must be a name with at least two alphabetic characters, it should have a reasonable maximum length, and it must not start or end with a hyphen. Two players in a team cannot have the same name
goals: type int, representing the number of goals. This will determine who is the top scorer at the Golden Boot.

Team:
name: Type string, representing the name of the participating team.
ranking: int type. The ranking must be between 1 and 4, no two teams can have the same ranking.
2 players: Player type. Each team will have two shooters.
Each team has a yellow card and a red card to score. Serious fouls will be shown yellow cards, while red cards will be shown to players who have fouled multiple times. These cards are associated with the team, not the player. The display of yellow and red cards is randomly determined, both are rare, and some games do not appear at all. But red cards are usually four times as many as yellow cards. The total number of yellow and red cards will determine the team's fair play score, which will be used to determine the Cup's fair play award. Each yellow card is worth one point and each red card is worth two points. The lower the total score, the fairer the team.
In addition to these, there must be a team class that can store and return information about the team's performance in games.
You can decide which of the following fields are yours: the number of games the team has played , the number of games won, lost, drawn , number of goals scored, and overall points.
Game class:
The Game class will have at least one fields, an ArrayList of Team objects. The Game class has at least three methods: playGames(), playPenaltyShootOut(), and displayGameResult()

playGames() simulates a game between two teams of a match by randomly generating the number of goals scored by each team. The number of goals generated should be within the specified range. The highest-ranked team will have a greater chance of winning. This would be simulated by giving the higher-ranked team a wider range of possible goals as follows:
? The higher-ranked team: Goals range from 0 to (5 + random number (random number between 0 and 2))
? The higher-ranked team Low Team: A 0 to ((5 - team ranking difference) + random number (random number between 0 and 2))
Two players randomly score.

The playPenaltyShootOut() method simulates a penalty shootout, and a penalty kick is required when the final ends in a draw. One player on each team has 5 shots. The team's players have the highest number of goals at the end of five wins. If the points are equal, then each player has one more shot. This continues until there are results. A goal scored by a player does not count towards the Golden Boot in a penalty shootout.

The displayGameResult() method displays the result at the end of the game, for example:
match result: Spain 4 vs Australia 0
Red and Yellow Cards: Australia - 1 red card.
Team records (matches, wins, etc.) are updated after the game is over.

When the program starts, the system reads the details of each team from the file 'teams.txt'. Details include the name and ranking of each team. Once the information is loaded from the file, there is no further activity to read or write to the file during the actual execution of the program.
The program then prompts the user to enter the names of two players on each team who will be the goal scorers. If the entered name is invalid, the user is prompted to re-enter it. If the name retyping is still invalid, the system automatically assigns a default value, such as player-1-peter.

The system will display menu options, use Scanner Class to get input.
A. Play Preliminary Stage
B. Play Final
C. Display Teams
D. Display Players
E. Display Cup Result
X. CloseIf
the player chooses A the preliminaries will begin.
If B is selected, the final will be between the top two teams in the preliminary round. If the preliminaries have not started when B is selected, an error message will be displayed. In the event of a tie, a penalty kick will go to the tie.
If C is selected, records for each team are displayed. E.g:

If D is selected, the players will list their number of goals, the list does not need to be sorted, for example:

if E is selected: the name of the champion team, the Golden Boot winner, the fair prize winner team will be displayed on the screen. For example:
Football World Cup Winner: Australia
Golden Boot Award: Ronaldo from Spain
Fair Play Award: Ghana and China
Please note that there can be multiple players winning the Golden Boot and there can be multiple teams winning the Fair Play Award.

After selecting A-E, the menu will be redisplayed.
If the user selects option 'X', the system should write the information displayed by E to a file called 'statistics.txt'. The system will close
http://www.daixie0.com/contents/9/1328.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325340998&siteId=291194637