subject

This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced 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). be careful with this and later parts of the problem to get the blank lines between blocks of interaction to print exactly the way shown in the expected output, since white space counts this time. also, any output in later parts of the problem must also be sorted with the jersey numbers in ascending order. hint: dictionaries cannot be sorted but dictionary keys can be stored in a sorted list. (3 pts)

ex:

enter player 1's jersey number:

84

enter player 1's rating:

7

enter player 2's jersey number:

23

enter player 2's rating:

4

enter player 3's jersey number:

4

enter player 3's rating:

5

enter player 4's jersey number:

30

enter player 4's rating:

2

enter player 5's jersey number:

66

enter player 5's rating:

9

roster

jersey number: 4, rating: 5

jersey number: 23, rating: 4

jersey 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 the option prompt, and then outputs the menu and the option prompt each time the user chooses an option and its execution finishes, i. e. the user provides the option's input, if any, and the program prints the option's output, if any. the program ends when the user chooses the option to quit. for this step, the other options do nothing. (2 pts)

ex:

menu
a - add player
d - remove player
u - update player rating
r - output players above a rating
o - output roster
q - quit choose an option:
(3) implement the "output roster" menu option, printing the players in the order of their jersey numbers, as in part (1) above. (1 pt)

ex:

roster

jersey number: 4, rating: 5

jersey number: 23, rating: 4

jersey 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:

49

enter 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:
23
enter 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, again in ascending order of jersey number.. (2 pts)

ex:

enter a rating:
5
above 5
jersey number: 66, rating: 9
jersey number: 84, rating: 7

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 15:10, shancaines17
Awould be a misconfiguration of a system that allows the hacker to gain unauthorized access, whereas is a combination of the likelihood that such a misconfiguration could happen, a hacker’s exploitation of it, and the impact if the event occurred.
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, Nason156
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
image
Computers and Technology, 24.06.2019 04:30, LouieHBK
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
image
Computers and Technology, 25.06.2019 15:30, ahrozycki
In a paragraph of no less than 125 words, explain what netiquette is and how it improves efficiency and productivity in the workplace.
Answers: 1
You know the right answer?
This program will store roster and rating information for a soccer team. coaches rate players during...

Questions in other subjects:

Konu
Mathematics, 25.07.2021 03:30
Konu
Health, 25.07.2021 03:30