It's baseball season again! Our next project centers around one way to statistically analyze starting pitchers
The Society of American Baseball Research (SABR) is a group of baseball fans, writers, historians, and other researchers. The members of SABR are intensely interested in and study all facets of the game. They have created Sabermetrics, which is the mathematical and statistical analysis of baseball records. One of the many topics studied by sabermetricians is pitching statistics and how to create ones that are more meaningful measures to use in the comparison of pitchers, both past and present.
One statistic that is used in the evaluation of starting pitchers is Game Score, developed by sabermetrics pioneer Bill James. (A modified version of Game Score was published by Tom Tango in 2016.) The original method for calculating the Game Score for a particular game is:
You have been asked to write a program that will, for a group of pitchers, calculate the Game Score for every game of each pitcher's season, along with that pitchers average Game Score. Your program will be processing a text file that contains the following information for each pitcher:
1st line: Name (25 characters, padded with blanks on the right), and Season (year) (an integer in columns 26-29).
Subsequent lines (one line per game): Innings Pitched (IP), Hits Allowed (H), Runs Allowed (R), Earned Runs Allowed (ER), Walks (BB), and Strikeouts (K).
You must create a data file (as described above and discussed in class) in order to test your program. Sample data (first few lines for Max Scherzer's 2017 season):
Max Scherzer 2017
6.2 4 2 2 2 7
6.0 4 3 1 2 10
Note that a different data file will be used to test your program.
Write a program that will process the data in such a file and will display (on screen) each pitcher's Name and the season, followed by the Game Score for each game started by the pitcher (one Game Score per line). At the end of a pitcher's data, the number of games started by that pitcher and the pitchers Average Game Score should be displayed. Show the Average Game Score to two decimal places (nearest hundredth).
Sample output (for the sample data shown above):
Max Scherzer 2017
Game Scores:
63
64
Number of Games Started: 2
Average Game Score: 63.50
You should make efficient use of functions in this program.