Menu

[Solved] C Program Program Store Roster Rating Information Soccer Team 3 Pieces Information Player Q37183936

In C Program

This program will store the roster and rating information for asoccer team.
There will be 3 pieces of information about each player:

Name: string, 1-100 characters (nickname or first name only, NOSPACES)
Jersey Number: integer, 1-99 (these must be unique)
Rating: double, 0.0-100.0

You must create a struct called “playData” to hold all theinformation defined above for a single player.

You must use an array of your structs to to store thisinformation. You will need an array capable of holding theinformation for 10 players.

You should initialize the struct elements of your array withappropriate values.

——————————————————————————–

You need to implement the following 2 functions to validate theuser’s input AND
use them in your implementation:

  bool jerseyValid(intplayeJerseyNumber);
bool ratingValid(double playerRating);

If the input value is not valid,
then the function returns false otherwise it should returntrue.

If the input data is not valid,
then break from the input process and redisplay the menu.

——————————————————————————–

You need to implement the following function AND use it yourimplementation

  void printPlayer(playerData*thisPlayer);

This function will take a pointer to a player informationstruct
and print all the information for one player, formatted as shownbelow:
Player Name
Player Jersey #
Player Rating

——————————————————————————–

Your 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 forthat value in the jerseyNumber array.

If found…return the index number
If NOT found…return a -1

You will need this function!

——————————————————————————–

You will implement a menu of options for the user to build andmodify the roster. Each option is represented by a singlecharacter. The program initially outputs the menu, prompts the userfor a choice and then processes that choice (HINT: this is a goodplace to use a switch statement.) The menu is provided as part ofthe 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: You do not need to 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 themenu

NOTE: You do not need to 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 themenu

——————————————————————————–

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 starrating
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

——————————————————————————–

HINT 1: Start with the EASY menu options, likequit. You can also create a player using assignment statements andimplement the printing options before tackling the add player anddelete player operations.

HINT 2: There are 2 ways to approach thisproject and the arrays.
– Keep a player count and then move data when removingplayers.
– Use an illegal jersey # when removing players (this is the easierapproach)

Expert Answer


Answer to In C Program This program will store the roster and rating information for a soccer team. There will be 3 pieces of info… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *