Given the successful compilation the program should run with the command line instruction:
./Football n a1 m1 d1 a2 m2 d2
where n is the number of games to be played. The value of n should be between 1 and 99 inclusive. The other parameters specify the number of players of different types in the team.
The structure of the simulation is such that two football teams will play n games against each other during the lifetime of the program. There are only two teams and they will be referred to as team1 and team2 in this specification. You need to store information about the records of the teams and the games they have played, specifically:
The heart of the simulation is in the people who play and look after the teams. Every person have a name and an age, these can be randomly generated, with the age being in a sensible range. People have various skills, as specified below. Each skill is in the range 1 to 100, with 100 the best and 1 the worst, and can never go outside those ranges.
There are three different support staff associated with each team.
Players themselves have a skill associated with their health, and start the tournament with health 100. There are four different types of players: attackers, midfielders, defenders and goalkeepers. You should give the players skills that appropriately represent how they interact during the game. You can assume that attackers and midfields contribute to the attack of a team and may score, while midfielders, defenders and goalkeepers contribute to the defence of a team. Midfielders may well have unrelated abilities as regards defending and attacking.
Each team has exactly 1 goalkeeper and a total of 11 players. The number of players of different types for each team are as specified by the command line parameters; so a1;m1; d1 as the number of attackers, midfielders and defenders, respectively, for team one; and a2;m2; d2 the analogous fields for team two. Bad data for a team, in particular not specifying a total of 10, should result in 3, 4, 3 being used. There are no reserves for the teams.
Initial skills ratings for staff and players should be randomly chosen in appropriate ranges, other than health. Skill ratings for staff don't change, but may for players. Daily salaries don't change, and should also be randomly chosen over what you consider a suitable range.
Here goes the basic structure of your program. You need to write whatever functions and data members you require to support a simulation which runs through as follows.
These teams play n games but the games are separated by 2-5 days each. There will always be a game on Day 1 of the simulation. On each non{playing day there are the following events.
On a playing day a game is played. The result should be determined by you to be a reasonable function of the skills, including the health, of the players. You also ...
The following is appropriate for output:
All output should be concise, for example one line per player, but clear.
Other than the initial command line input, the program should run without prompting. Thus we expect to be able to type
./Football 4 2 4 4 4 3 3 > Output.txt
and have the output all in Output.txt.
You should spend some time play-testing to make sure you get somewhat sensible results. Thus 20-0 as a game result might be fine if you have a team with ratings in the 80s vs one in 20s, but it shouldn't be a common result for balanced teams.