logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Bobby DavroComputer science
(5/5)

633 Answers

Hire Me
expert
Rooma KalranMarketing
(5/5)

893 Answers

Hire Me
expert
Nikhil JainComputer science
(5/5)

587 Answers

Hire Me
expert
Alexx WardEconomics
(5/5)

539 Answers

Hire Me
Others

provided for you is the ScoreEntry class which contains the player name and score of each entry on the scoreboard

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Task 1 - (20 marks) For this task, you are to write code that manages the scores for a computer game and prints the leaderboard. Instructions The scoreboard program found below is currently missing two important pieces of functionality - it doesn't record scores, nor is it able to print the leaderboard. Provided for you is the ScoreEntry class which contains the player name and score of each entry on the scoreboard, and the Scoreboard class which is responsible for maintaining the list of score entries. Your task is to implement this missing functionality by adding two methods to the Scoreboard class as described below. add_score This method is to take a player's name and their score as arguments, create a new ScoreEntry object, and then append it to the appropriate list of scores. print_leaderboard This method is to take no arguments and print the name and score of the top three players in descending order of score. Hint: If you find your solution printing the bottom three scores, you may need to look at the documentation, and in particular the "reverse" named argument. Requirements To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements: You must use the sort method (hint: the provided function get_score will come in handy). You must use list slicing as part of your solution. You must not use list indexing to retrieve individual list items. You must not use break, continue or return statements in print_leaderboard. Example Runs Run 1 Bob: 12103 Charlie: 8762 Alice: 7821 Your code should execute as closely as possible to the example runs above. To check for correctness, ensure that your program gives the same outputs as in the examples, as well as trying it with other inputs.

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme