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
What are your undertale + au ships?
fenix001 [56]
What is an undertale? Lol
3 0
3 years ago
This is going to get taken down but I dont care add me on discord cause ima bored<br> -Red-#9847
Alex777 [14]

Answer:

I WILL

Explanation:

6 0
2 years ago
Web designers use programming languages to write websites. A True <br> B False​
KonstantinChe [14]

Answer: False

Explanation:

Web designers are not using programming languages to write websites.

6 0
2 years ago
Read 2 more answers
Can i get any information on this website i'd like to know what its for ?
zloy xaker [14]

Explanation: torsearch.org is a safe search engine mainly used for dark wed purposes. It does not track your location nor give any personal information.

8 0
2 years ago
For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
Paul [167]

Answer:

  • Interactive media
  • Information services and support
  • Programming and software development
  • Network systems administration

Explanation:

The company has finished designing a software program, but users aren’t sure how to use it. <u>interactive media</u>

Several people in the human resources department need new software installed. <u>information services and support</u>

An employee has an idea for a software program that can save the company time, but doesn’t know how to write it. <u> programming and software development</u>

A new branch of the company is opening soon, and the computers there need to be connected to the Internet. <u>network systems administration</u>

<u>OAmalOHopeO</u>

3 0
2 years ago
Other questions:
  • Write a program that takes two ints as input from the keyboard, representing the number of hits and the number of at bats for a
    10·1 answer
  • Which of the following characteristics relates to authentication header (AH)? It is a document that defines or describes compute
    11·1 answer
  • What can you do with someone's ip address?
    9·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =
    7·2 answers
  • Overlay analysis is ____________, taking in data from two or more layers to create a single output layer.
    5·1 answer
  • What is it called when an attacker convinces you to enter personal information at an imposter website after receiving an email f
    10·2 answers
  • Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?
    6·1 answer
  • What is a type of transition used for music in Earsketch
    11·1 answer
  • How to check the at&amp;t internet speed on my computer
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!