Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Note: this question is to be programmed in Java. Note: You cannot use the array class or any other class for this problem. You can
Note: this question is to be programmed in Java.
Note: You cannot use the array class or any other class for this problem.
You can only use methods inside the main method.
This program is about generating a road map of matches and related goal statistics in the FIFA World Cup Final. The game is repeated until your favourite soccer team (country) wins the Final in a tournament, or until a maximum number of tournaments. For simplicity, we will start from the Round of 16. Assume that you are given the list of 16 countries in an array. You will ask the user for his/her favourite team (keyboard input). Your program will then output a possible road map of 8 matches in the Round of 16, 4 Quarter Finals, 2 Semi-Finals, 1 Final, and the final winner of a tournament. A tournament is repeated (with the same list of countries) until the user's chosen team wins, or the max number of tournaments specified in the program has reached (e.g., 20 tournaments). At the end, you will show total scores in each match, the average goals for each tournament, the overall average for all tournaments in the game, and the total number of matches where the number of goals is greater than the overall average. Note that a match is played between two teams/countries, a tournament consists of all the matches leading to a final winner (i.e., all matches including the final), and the game includes all the tournaments until your favourite team wins, or the max tournament count is reached. r program should proceed as follows: 1. The names of the teams are provided as an array of Strings ou String [ ] teams 1 6 = {"Uruguay", "Portugal", "France", "Argentina", "Brazil", "Mexico", "Belgium", "Japan", "Spain", "Russia", "Croatia", "Denmark", "Sweden", "Switzerland", "Colombia", "England"; 2. Ask user for her favourite team. If the provided team does not exist in the 16 names, you exit with a proper message (e.g., "Your team is not in the Round of 16). Ignore case, and any additional white-spaces entered by the user 3. Generate the output roadmap as follows. Choose teams in pairs for each match (e.g take the first two teams from your array for Match 1, and the next two teams for Match 2, and so on). The winner of each match is selected as follows: in the given 90-minute period, each team scores between 0 to 4 goals (generated randomly using the Java Random class), the team with more goals wins. If the play is a draw after 90 minutesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started