Assignment 1: Prompt the user for 5 pairs of numbers. The pairs consist of a player’s jersey number (0-99) and the player’s rating (1-9). Make sure to use good prompts and check the user’s input using a while loop. Do not stop the program if the input is outside the range. You need to prompt the user until they get the numbers correct. Store the pairs in a dictionary. Since the player’s jersey number is a key, you need to check for duplicates and prompt user again if the number is already in use. After all players are entered, print the roster with the jersey numbers in ascending order. Next, print a menu for the user to be able to modify the roster. They should be able to add a new player, remove a player, update a player’s rating, output a list of players above a rating (get the cutoff from the user), output the roster, or quit. You need to turn in a written algorithm for this project before starting to write the program. Assignment 2: Change assignment 1 to use functions. You need to have a function for printing the menu and one function for each of the menu items, at least. You can use other functions if you would like. I want just the code for this part. Your algorithm will be included in the final paper. Essentially, use the first assignment instructions but use functions for what assignment 2 asks. I can submit my code in another question if need be.
Assignment 1:
Prompt the user for 5 pairs of numbers. The pairs consist of a player’s jersey number (0-99) and the player’s rating (1-9). Make sure to use good prompts and check the user’s input using a while loop. Do not stop the
Next, print a menu for the user to be able to modify the roster. They should be able to add a new player, remove a player, update a player’s rating, output a list of players above a rating (get the cutoff from the user), output the roster, or quit.
You need to turn in a written
Assignment 2:
Change assignment 1 to use functions. You need to have a function for printing the menu and one function for each of the menu items, at least. You can use other functions if you would like. I want just the code for this part. Your algorithm will be included in the final paper.
Essentially, use the first assignment instructions but use functions for what assignment 2 asks.
I can submit my code in another question if need be.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 8 images