Question: {BASIC C PROGRAM} include Create a player position enum with the following positions: - GOALKEEPER - FORWARD - BACK - MIDFIELDER Replace multiple arrays with

{BASIC C PROGRAM} include Create a player position enum with the following positions: - GOALKEEPER - FORWARD - BACK - MIDFIELDER Replace multiple arrays with a single array and create a struct to hold all the player information. typedef struct playerData_struct { Jersey Number (integer, between 1-99) Player Name (char [100] array) Player Rating (double, between 0.0-100.0) Player Position (one of the 4 enum values defined above) } playerData; Add the following 2 functions to validate the user's input AND use them in your implementation: bool jerseyValid(int playeJerseyNumber); bool ratingValid(double playerRating); If the input value is not valid, then the function returns false otherwise it should return true. If the input data is not valid, then break from the input process and redisplay the menu. Add the following function AND use it in the implementation void printPlayer(playerData* thisPlayer); This function will take a pointer to a player information struct and print all the information for one player Player Name Player Jersey # Player Rating ----------------------------------------------------------------------------- This program will store the roster and rating information for a soccer team. There will be 3 pieces of information about each player: Name: string, 1-100 characters (nickname or first name only) Jersey Number: integer, 1-99 (these must be unique) Rating: double, 0.0-100.0 Use 3 arrays to store this information. Initialize each array with appropriate values. There will be no more than 10 players on each team. Implement a menu of options for the user to build and modify the roster. Each option is represented by a single character. The program initially outputs the menu, prompts the user for a choice and then processes that choice (HINT: this is a good place to use a switch statement.) The menu is provided as part of the start code and looks like this: MENU a - Add a new player u - Update player information r - Remove a player from the roster d - Display player information p - Print the full roster s - Print "Star" players q - Quit Please make a selection: Each option should operate as follows: ------------------------------------------------------------------------------------------- a - Add a new player, prompts the user as follows Enter player jersey number: Enter player first or nick name: Enter player rating: NOTE: lookup the player info by jersey number... if found...display an error message and return to the menu if not found...enter the data as above NOTE: If the maximum number of players has been entered... display an error message and return to the menu NOTE: Do not validate the range of the rating. (HINT: entering the player name can be done with a scanf) ------------------------------------------------------------------------------------------- u - Update player information Enter player jersey number: NOTE: lookup the player info by jersey number... if found...prompt for name and rating as in option 'a' if not found...display an error message and return to the menu NOTE: Do not validate the range of the rating. ------------------------------------------------------------------------------------------- r - Remove a player from the roster Enter player jersey number: NOTE: lookup the player info by jersey number... if found...remove the player if not found...display an error message and return to the menu ------------------------------------------------------------------------------------------- d - Display player information Enter player jersey number: Display the following: Name: Jersey #: Rating: NOTE: lookup the player info by jersey number... if found...display the information if not found...display an error message and return to the menu ------------------------------------------------------------------------------------------- p - Print the full roster Prints all the information for all the players: ROSTER ------- Player Name 1 Player Jersey # Player Rating Player Name 2 Player Jersey # Player Rating ... for as many players as have been entered ... ------------------------------------------------------------------------------------------- s - Print "STAR" players Prints all the players with a rating greater than the star rating Prompt the user as follows: Enter "STAR" rating: MY STARS -------- Player Name 1 Player Jersey # Player Rating Player Name 2 Player Jersey # Player Rating ... for as many players as meet the criteria... and there may be none! ------------------------------------------------------------------------------------------- q - Quit Normal exit for the program ------------------------------------------------------------------------------------------- The program will need to implement the following function: int findPlayer(int whichPlayer, const int jerseyNumbers[], int maxJersyCount); This function takes a player jersey 3 (whichPlay) and looks for that value in the jerseyNumber array. If found...return the index number if NOT found...return a -1

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!