Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write in ECLIPSE JAVA . Please no buffered readers. I am a beginner at this and would like explanations in the code to understand

Please write in ECLIPSE JAVA. Please no buffered readers. I am a beginner at this and would like explanations in the code to understand the material. You have to code the whole program(JAVA) and follow all the concepts. The output has to look exactly like the one shown below. Thank you.

image text in transcribedimage text in transcribedimage text in transcribed

Objective: Write a program which simulates a hot potato game. In this version of a classic game, two or more players compete to see who can hold onto a potato the longest without getting caught. First the potato is assigned a random value greater than one second and less than three minutes both inclusive. This time is the total amount of time the potato may be held in each round. Next players are put into a circular list. Then each person gets possession of the potato in order. The player with the potato indicates how long they wish to hold on to it by entering a number from 1-10 seconds. If the player's time is less than the remaining potato possession time then it moves on to the next player. However, if the time is larger, then the player is removed from the circular list and the potato's time is reset. This is done until there is one player remaining Notes: The number of players has to be greater than 1 and specified by the user . Player's then may enter their namcs. If a player picks a value outside of 1-10 then their pick is defaulted to 10 . Once a game is over the user is prompted whether or not to play again. . You must create your own circular linked list. This is very similar to the structure taught in class except the last element links to the first element . You may either choose to do a single or double linked list. Using multiple objects may make this the solution easier and extendable Welcome to the Hot Potato Game! Enter the number of players (2 or more required) Enter the player 's name Human H. Human Enter the player 2's name Person H. Person Enter the player 3 s name NotLizard H. NotLizard Human H. Human Enter a number from 1-10 c rresponding to the number of seconds to hold the potato Human H Human is safe for now Person H. Person Enter a number from 1-10 corresponding to the number of seconds to hold the potato Per on H. Person safe for now NtLizard H. NotLizard Enter a number from 1-10 c rre sponding to the number of seconds to hold the p tat 10 NotLizard H. NotLizard is saf for now Human H. Human Enter a number from 1-10 corresponding to the number of seconds to hold the potato The number must be between 0 and 10. We will assume you meant 10 Human H. Human is safe Eor now Person H. Person Enter a number from 1-10 corresponding to the number of seconds to hold the p tato 10 HOT POTATO!Person H. Person has been eliminated! NotLizard H. NotLizard Enter a number from 1-10 corresponding to the number of seconds to hold the potato NotLizard H. NotLizard is safe for now Human H. Human Enter a number from 1-10 corresponding to the number of seconds to hold the potato 10 Human H. Human is safe for now NotLizard H. NotLizard Enter a number from 1-10 corresponding to the number of seconds to hold the potato NotLizard H. NotLizard is safe for now Human H. Human Enter a number from 1-10 corresponding to the number of seconds to hold the potato 10 HOT POTATO! ! Human H. Human has been eliminated! NotLizard H. NotLizard WINS! w uld you like t continue? Press ENTER t cntinue or enter "quit" tquit quit Goodbye

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

How does having more metadata help a tax accountant minimize taxes?

Answered: 1 week ago