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
Which of the following are benefits of designing a scalable system? Choose 3 options.
Svetllana [295]

Explanation:

ability to maintain a high level of service for costumers

users may never know when a sight has experienced tremendous growth

ability to respond to users volume issues more quickly

4 0
3 years ago
5. Write a program to remove any duplicate letters from a word and display the new word maintaining the original order. For exam
dexar [7]

Answer:

word = input('Enter a single word: ', 's');

n = length(word);

nodupWord = [];

for i = 1:n

  dup = false;

  c = word(i);

  for j = 1:i-1

      if word(j) == c

          dup = true;

          break;

      end

  end

  if ~dup

      nodupWord = [nodupWord, c]; %add the non-duplicate char to end

  end

end

disp(['Adjusted word: ', nodupWord])

Explanation:

The code is in Python.

3 0
3 years ago
13) What are the benefits and detriments of each of the following? Consider both the systems and the programmers’ levels. a. Sym
dsp73

Answer:

Automatic and Explicit Buffering.

In the case of explicit buffering, the length of the queue is provided while in automatic buffering the queue size needs to be indefinite. In automatic buffering there is no need to block the sender while coping the message. While in explicit buffering the sender is blocked for the space in queue.

No memory is being wasted in explicit buffering.

Send by Copy and Send by Reference.

By using the send by copy method, the receiver is not able to change the state of parameter while send by reference allow. The advantage of using the send by reference method is that it allows to change a centralized application to its distributed version.

Fixed-sized and Variable-sized Messages.

In fixed size messaging refers, the buffer size is fixed. This means only a particular number of messages can only be supported by the fixed size buffer. The drawback of the fixed size messages is that they must be a part of fixed size buffer. These are not a part of variable size buffer. The advantage of variable size message is that the length of the message is variable means not fixed. The buffer length is unknown. The shared memory is being used by the variable size messages.

Explanation:

5 0
3 years ago
ROM is designed for _________
Sidana [21]
Computer Instructions

ROM, or Read Only Memory is used to store instructions as it retains memory even after power loss.
6 0
3 years ago
_____ is when a person connects their location to photos that are posted online.
Margaret [11]
B) friend tagging is when
4 0
3 years ago
Read 2 more answers
Other questions:
  • What are examples of some Exotic currencies?
    14·1 answer
  • Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValN
    7·2 answers
  • To increase the view of a document on the screen, use the _____. View icon Zoom slider full-screen reading boldface font
    9·1 answer
  • What is computer hacking?
    11·2 answers
  • Discuss advantages and disadvantages of Twisted Pair?
    6·1 answer
  • 1. A tachometer measures:
    8·1 answer
  • Any part of the computer that you plug into the CPU like a phone, tablet, headphones etc. are called
    5·1 answer
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • Leroy wants to keep the bride and groom in a picture, but remove the rest of the family. Which photo-editing tool should Leroy u
    14·1 answer
  • Edhesive 7.6 lesson practice python
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!