Good Day,
I really need your help with this program.
Question: FIFA 2010 Group match
During the world cup, 32 of the best teams fight it out for the coveted world cup trophy. The teams are placed in eight groups of four. In each group, the teams play each other once, meaning each team will play a total of three games. If a team wins it gets 3 points, a draw 1 point and loss 0 points. At the end of the three games, the teams are ordered (sorted) by the number of points they will have amassed (Log standing). If teams are tied on points, then the team with a better goal aggregate is considered the better team. Goal aggregate is goals scored by the team less goals scored against the team.
You are to simulate group matches for a group with South Africa, Mexico, Uruguay and France. Your program should play two teams at a time and for each game display the scores for the teams, and display who won.
After all the teams have played, display for each team the number of games played, the number of games won, the number of games drew, the number of games lost, the total scores for the team, the total scores against the team and the total points for the team.
Show this information before sorting and after sorting. Your program can then select the top two teams to proceed to the next round.
Use the following criteria for the games:
1.All teams are assumed to have the same rating.
2.A game consists of 90 minutes.
3.0.5% of the times, a team scores
4.0.3% of the times a team is awarded a penalty.
5.If a team is awarded a penalty, 50 % of the times they score.
Hint, in the playing function, generate numbers 1 through 1000, with any 5 being the chance to score and any 3 being a chance to be awarded a penalty.
In the penalty function, generate any 2 successive numbers, with one for a score and the other for a miss.