Create a new .cpp program that reads the data from footballstats.txt (under Resourses-Examples) using a while-loop. Your program will use a counting loop to (a) determine what type of player a data row indicates, and (b) determine the average weight of those player types and all the players listed in the text file.
As the program reads the data from the file, it must determine if the player is a lineman, a back, or other. (You will use an if...else if...else block to do this.) To determine the type of player a data entry represents, assume that all numbers between 1 and 49 are backs, between 50 and 79 are linemen, and between 80 and 99 are other types. Use counters to keep track of the number of each type of player (using the ++ operator), and use other variables to determine the total weight of each type of player (use the += compound operator). When you reach the end of the file, stop the while loop (use a counting option for this program, and stop after reading the 20 lines in the file). When all the data has been read, calculate the average weight of each group of player types, and then the average weight of the entire team. Print the results to both the screen and to a file named yourname_average_weight.txt, with appropriate labels.