Create a structure player_t to store the players name and their last three at ba
ID: 3647016 • Letter: C
Question
Create a structure player_t to store the players name and their last three at bats. You will create an array of this structure in the main function. Although the exact number of players is not known prior to entry, there will be no more than 10 at bats by a player in a single game. All data should be INPUT into array of structures before any calculations are done.Excluding the "-----...", the output list should be similar to this:
-------------------------------------------------------------
Enter Name <Ctrl-Z to stop>: Juan Lopez
Enter the number of at bats for the last three games: 3 2 4
Enter Name <Ctrl-Z to stop>: Manny Smith
Enter the number of at bats for the last three games: 6 2 4
Enter Name <Ctrl-Z to stop>: ^Z
Name Games 1 Games 2 Game 3 Average
Juan Lopez 3 2 4 3.0
Manny Smith 6 2 4 4.0
The average number of at bats for the last three game is : 3.5
Press any key to continue...
-------------------------------------------------------------
I've been working on this for a week now, and I am having problem getting the program to work properly. I can't get the loop to store the values of the previous players and their respective scores when it comes time to display them. Also, I'm having problems terminating the loop with 'Ctrl-Z'. Please explain your method, it will help so much.