Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a program in C to read a file., and fill in the below mentioned arrays. Input file is in the below format. player1,Center|88in,75kg|8,6,0,0,5,4|5,3,0,3,1,3 player2,Guard|183cm,170lbs|12,8,3,0,2,0|1,5,1,0,1,2

write a program in C to read a file., and fill in the below mentioned arrays.

image text in transcribed

image text in transcribed

Input file is in the below format.

player1,Center|88in,75kg|8,6,0,0,5,4|5,3,0,3,1,3 player2,Guard|183cm,170lbs|12,8,3,0,2,0|1,5,1,0,1,2 player3,Forward|178cm,76kg,12,6,0,0,4,1|3,32,1,0,4

int g_player_count; char g_player_name[MAX_PLAYERS][NUM_ATTR] [MAX_NAME_LEN]; int g_attributes[MAX_PLAYERS][NUM_ATTR]; int g_shooting[MAX_PLAYERS] [NUM_COLS]; in't g_statistics[MAX_PLAYERS][NUM_COLS]; This function will open the file specified by the first argument and read in the records, filling the g-player_name, g_attributes, g_shootings and g_statistics arrays. From the input file, the height of a player can be given in inches or in centimeters, and the weight of a player can be given in kilograms or lbs. You need to convert them into the nearest inch and pound, respectively. Thinfunction should return the total number of players read and set g_player_count to be the number of players read in from the file (even if an error occurred). If any errors occur, you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago