Assignment title: C Programming
Question
C++ programming
Q
Preparation for this assignment mostly consists of making sure that your Visual Studio 2012 Solution and Project Spaces for the assignment are set up correctly so that you can easily submit the required files. You will need to set up a new solution called cstudentnumberPA2 within your U:\GENG1003 folder. Within the solution have a single project called Assignment2.
PROBLEM STATEMENT:
The Bowling Coach of the Australian Cricket Team is preparing for a new and very busy season of international cricket. On the latest tour of South Africa he has had his laptop fail, leaving the only computing resource available to him as a computer that could run a simple C program with simple text file(s) as input. So for this season he wants to be prepared.
He needs to be able to report on team performance, particularly in this case bowling performance, and to give a comparison of bowling performances across the team. You will need to write a program that allows the coach to feed in a simple text file of individual bowling performances and produce lists that are ordered alphabetically, as well as in performance order (defined later). This program is to be available in case an equipment failure happens again.
Initially the team will consist of a squad of 15 players, but altering this to allow for more players (in a subsequent compile and run of the program) should be made as easy as possible.
BACKGROUND:
In cricket, batsmen take their individual turns in the middle of the oval and score runs. Each turn in the middle is called an innings and they bat until they get out (called a completed innings). The collective score for the whole team is called the Innings Total for the team. While batters bat, bowlers from the opposing team bowl (or deliver) the cricket ball at them and try to get the batter out, as well as trying to prevent the batter from scoring runs. At the end of the innings, as well as batting details being reported for each batter in the batting team, the bowling details for each bowler in the bowling team are also reported. We will focus solely on bowling data from here on.
Across their career, or in this case just for the whole of the Australian summer, a bowler's average is given by the total number of runs conceded, divided by the number of wickets taken (the number of batters the bowler got out). Traditionally, a bowling average is reported accurate to 2 decimal places. Another important statistic for a bowler is the strike rate which is the number of deliveries bowled (on average) for each wicket taken. This is generally reported correct to the nearest whole number (0 decimal places). If the number of wickets taken is zero then the bowler does not have an average or a strike rate to report and these are left blank in any printed report.
There are some extra peculiarities on the way a bowling performance is reported. An over consists of 6 deliveries (bowling at a batter 6 times), and the amount of bowling done is measured in overs. So the number of deliveries bowled is 6 times the number of overs bowled.
Some who are familiar with cricket statistics will know that it is possible for a partial-over to be bowled, but we will not worry about this – for us, a bowling performance will consist of an integer number of overs.
A maiden over is an over where the batter does not score any runs.