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, 22.06.2019 21:30, sunshinekisses
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
image
Computers and Technology, 23.06.2019 01:00, leo4687
Complete the sentence about a presentation delivery method
Answers: 2
image
Computers and Technology, 23.06.2019 22:20, tagerryawilson6
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
image
Computers and Technology, 24.06.2019 07:40, daebreonnakelly
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
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: