1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kkurt [141]
3 years ago
15

This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balance

d team.(1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers and the ratings in a dictionary. Output the dictionary's elements with the jersey numbers in ascending order (i.e., output the roster from smallest to largest jersey number). Hint: Dictionary keys can be stored in a sorted list. (3 pts)Ex:Enter player 1's jersey number: 84Enter player 1's rating: 7Enter player 2's jersey number: 23Enter player 2's rating: 4Enter player 3's jersey number: 4Enter player 3's rating: 5Enter player 4's jersey number: 30Enter player 4's rating: 2Enter player 5's jersey number: 66Enter player 5's rating: 9ROSTERJersey number: 4, Rating: 5Jersey number: 23, Rating: 4Jersey number 30, Rating: 2...(2) Implement a menu of options for a user to modify the roster. Each option is represented by a single character. The program initially outputs the menu, and outputs the menu after a user chooses an option. The program ends when the user chooses the option to Quit. For this step, the other options do nothing. (2 pts)Ex:MENUa - Add playerd - Remove playeru - Update player ratingr - Output players above a ratingo - Output rosterq - QuitChoose an option: (3) Implement the "Output roster" menu option. (1 pt)Ex:ROSTERJersey number: 4, Rating: 5Jersey number: 23, Rating: 4Jersey number 30, Rating: 2...(4) Implement the "Add player" menu option. Prompt the user for a new player's jersey number and rating. Append the values to the two vectors. (1 pt)Ex:Enter a new player's jersey number: 49Enter the player's rating: 8(5) Implement the "Delete player" menu option. Prompt the user for a player's jersey number. Remove the player from the roster (delete the jersey number and rating). (1 pt)Ex:Enter a jersey number: 4(6) Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. (1 pt)Ex:Enter a jersey number: 23Enter a new rating for player: 6(7) Implement the "Output players above a rating" menu option. Prompt the user for a rating. Print the jersey number and rating for all players with ratings above the entered value. (2 pts)Ex:Enter a rating: 5ABOVE 5Jersey number: 66, Rating: 9Jersey number: 84, Rating: 7...
Computers and Technology
1 answer:
strojnjashka [21]3 years ago
5 0

Answer:

#include<stdio.h>

//function declaration

int search(int jersey[],int n);

void display(int jersey[],int rating[],int n);

int main()

{

char choice = ' ';

int jersey[5];

int rating[5];

int j=0,r=0,index;

for(int i=0;i<5;i++)

{

printf("Enter player's %d jersey number: \n",i+1);

scanf("%d",&j);

jersey[i] = j;

printf("Enter player's %d rating: \n",i+1);

scanf("%d",&r);

rating[i] = r;

}

while(choice != 'q')

{

printf("u- Update player rating\n");

printf("a- Output player above rating\n");

printf("r- Replace\n");

printf("o- Output roaster\n");

printf("q- Quit\n");

printf("Enter your choice(u,a,r,o,q): ");

scanf(" %c",&choice);

switch(choice)

{

case 'u':

printf("Enter jersey number: ");

scanf("%d",&j);

printf("Enter a new rating for a player: ");

scanf("%d",&r);

index = search(jersey,j);

rating[index] = r;

break;

case 'a':

printf("Enter a rating: ");

scanf("%d",&r);

display(jersey,rating,r);

break;

case 'r':

printf("Enter jersey number: ");

scanf("%d",&j);

index = search(jersey,j);

printf("Enter a new jersey number: ");

scanf("%d",&j);

jersey[index] = j;

printf("Enter a rating of new player: ");

scanf("%d",&r);

rating[index] = r;

break;

case 'o':

for(int i=0;i<5;i++)

{

printf("Player %d -- Jersey number: %d, Rating: %d\n",i+1,jersey[i],rating[i]);

}

break;

case 'q':

break;

default:

printf("You have enter wrong choice\n");

break;

}

}

}

int search(int jersey[],int n)

{

int i;

for(i=0;i<5;i++)

{

if(jersey[i] == n)

break;

}

return i;

}

void display(int jersey[],int rating[],int n)

{

for(int i=0;i<5;i++)

{

if(rating[i] >= n)

{

printf("Player %d -- Jersey number: %d, Rating: %d\n",i+1,jersey[i],rating[i]);

}

}

}

Explanation:

You might be interested in
Peter works on a huge database of numerical figures in a worksheet ranging from cell A1 to cell I50. He has to print the workshe
Amiraneli [1.4K]
Landscape and portrait page orientation.
4 0
3 years ago
Read 2 more answers
What is the output of the following code segment?
Aliun [14]

Answer:

o

Explanation:

8 0
3 years ago
FREEFREEFREEFREEFREEFREE
Brrunno [24]

Answer:

niceeee :0

Explanation:

5 0
3 years ago
Read 2 more answers
For which of the four game elements will you give a detailed description about the challenges that the player will face, such as
vaieri [72.5K]

The four game elements that will give you  a detailed description about the challenges that the player will face is option D: objective.

<h3>What goals does game development have?</h3>

To bring about creativity and originality in task completion and issue solving. to prepare pupils for group collaboration.

Note that giving the player a clear objective gives them something to aim for. Make sure the player can relate to this motivation.

Therefore, The most crucial component of a game can be its objectives, which determine how the game is won or lost, what the player is instructed to perform in-game, and what the player must do to gain optional <em>Achievements</em>.

Learn more about objective from

brainly.com/question/18516671
#SPJ1

3 0
1 year ago
Define quality control​
tangare [24]

Quality control is a system of maintaining standards in manufactured products by testing a sample of the output against the specification.

8 0
3 years ago
Other questions:
  • When you boot up a computer and hear a single beep, but the screen is blank, what can you assume is the source of the problem?
    11·2 answers
  • Identify the causes of configuration problems. (choose all that apply)
    9·2 answers
  • What is ucspi-tcp pakage in qmail??
    5·1 answer
  • Alternating Current or AC is better for use in ___________, while DC direct current is needed in _________ .
    15·2 answers
  • Do you watch markiplier?
    13·2 answers
  • Often an extension of a memorandum of understanding (MOU), the blanket purchase agreement (BPA) serves as an agreement that docu
    11·1 answer
  • What are the factors that affect self-confidence?
    15·1 answer
  • A Network Intrusion Detection System watches for potentially malicious traffic and _______ when it detects an attack.
    15·1 answer
  • The Internet is a worldwide communications network. Which device connects computer networks and computer facilities?
    11·1 answer
  • A time stamp indicates the date and time that a measurement was taken. A data scientist has a list containing 10,000 time stamps
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!