Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ A file contains a number of football players and the yards they gained rushing each season over the course of their playing career.
In C++
A file contains a number of football players and the yards they gained rushing each season over the course of their playing career. Not all players played the same number of seasons. Write a program that reads each player from the file and totals their rushing yards each season to output their career rushing totals. For example, the input file may look like (not actual numbers): Barry Sanders 1516 1319 1108 1875 -999 Emmitt Smith 1892 1333 1739 1922 1913 1733 -999 Walter Payton 1999 1827 1725 1677 -999 Etc. Where the -999 signals the end of their rushing stats (do not include the -999 in each players' total). Sample output from the above input would look like: 5818 Player Yards Barry Sanders Emmitt Smith. Walter Payton 10532 7228 - No documentation (-5) - Weak documentation (-3) - Must read from an input file (-5) - Needs a while loop to read from the file and then another while loop (or for) within the outer loop to read each players' yards (-6 if not set up correctly) - Each iteration of the loop, should output the values for the players name and their yards (-4 if not) - Output formatting (up to -3) - Incorrect output (up to -8) - Inefficiencies, up to -5 and noted whyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started