This essay has been submitted by a student. This is not an example of the work written by professional essay writers.
Uncategorized

Part-1 Design

Pssst… we can write an original essay just for you.

Any subject. Any type of essay. We’ll even meet a 3-hour deadline.

GET YOUR PRICE

writers online

Part-1 Design

Explain how your design will be able to store the information of games, athletes and user predictions.

Ans – To store game data Hashmap is used. Its key is String, and it will store Game type. Its value is List of athletes. User predictions are stored in Driver class instance variable “predictWinnerName.”

 

Explain how your class hierarchy will forbid a user from creating a “generic” type of participant (i.e., not an athlete nor an official)

Ans- I have created abstract class “Participant” which stores common information of official and athlete. It stores name, age, and state. After that, I have created an Official class which inherits Participant class, and its additional variable is ID.

Similarly Athletes class inherits Participant class, and it has additional variable like – ID, Athletic Type, last game point, total points, completeTime.

 

Explain the process by which your program will maintain a game and give the correct score to athletes according to their performance.

Ans- To maintain game HashMap is used. For the correct score, I have added variable “totalPoints” that will store total score from the beginning. When any game is finished score is provided to first three winners and also according to that “TotalPoints” are getting updated.

 

Explain how a user prediction can be checked with the actual game results.

Ans- When the user starts a new game, we are asking to predict winner name. After that start game option is selected which generates a score of each athlete that are participants in-game and their result is sorted in ascending order. From that first three winners are taken, and first winner name is getting matched with predict name. If they are same, displaying the message that you are the winner.

  Remember! This is just a sample.

Save time and get your custom paper from our expert writers

 Get started in just 3 minutes
 Sit back relax and leave the writing to us
 Sources and citations are provided
 100% Plagiarism free
error: Content is protected !!
×
Hi, my name is Jenn 👋

In case you can’t find a sample example, our professional writers are ready to help you with writing your own paper. All you need to do is fill out a short form and submit an order

Check Out the Form
Need Help?
Dont be shy to ask