Question: C Language This assignment will make use of structs and reading from a file. Include detailed comments in code. For this assignment you must create

C Language

This assignment will make use of structs and reading from a file. Include detailed comments in code.

For this assignment you must create an array of structs that will record the statistics of 5 players basketball games

the 1st line is the name of the player the 2nd line is the number of points scored by the player per game the 3rd line is the number of assists by the player per game the 4th line is the number of rebounds per game

Example of input file format:

James 11 21 14 17 12 30 22 25 31 33 0 15 2 5 3 17 6 9 11 1 4 7 5 6 10 3 8 8 3 10 6 5 7 10 11 9 6 13 3 5 4

Austin 15 10 23 31 25 22 30 12 17 14 21 1 2 3 3 7 6 9 7 10 4 6 9 9 2 1 3 2 10 7 9 6 7 3 3 2 4 6 9 2 1 3

The goal of this section is to have you read in this information from a file and save it into an array of structures which represent the player statistics

** There are 5 players **

**A max of 15 games**

You need to complete the following operations on the data:

1. Calculate total points of each player

2. Calculate total rebounds of each player

3. Calculate total assists for each player

4. Determine the leading scorer

5. Determine the leading rebounder

6. Determine assist leader

Requirements: - Your program must read input from a file in the proper format, NOT stdin - Your program should accept the filename from the commandline as shown in the example below

Example: $ ./a.out infile.txt

James points total: 231

James total rebounds: 97

James assist total: 100

Austin points total: 221

Austin total rebounds: 81

Austin assist total: 74

Points leader: James

Rebound leader: James

Assist leader: James

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!