Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java During each round, players choose a move, which may be either Koiiug, Bjorn, Ghftyd or Vhioft. The rules are: Kijkhg beats Bjorn and Ghftyd

Javaimage text in transcribed

During each round, players choose a move, which may be either Koiiug, Bjorn, Ghftyd or Vhioft. The rules are: Kijkhg beats Bjorn and Ghftyd Bjorn beats Ghftyd Ghftyd beats Vhioft Vhioft beats Koiiug and Bjorn The computer wins in the event of a tie. Your program should behave as follows: The rules should be printed to the screen The user is asked if they'd like to play a round o if they choose 'y', a round is played o if they choose 'n', the program ends Until the user has chosen to quit, another round is played. In a round of play: o The user is asked to enter a move, which may be either 'Bjorn', 'Ghftyd, 'Koiiug, or 'Vhioft. The program should continue to prompt the user until a valid move is entered. O The computer makes a move at random. (Hint: remember how we generated random numbers in class.) o The program prints the computer's move, the user's move, and who is the winner of this round. O The user is asked if they'd like to continue. When the user has decided to quit the game, the program prints the number of: O rounds played O times the user won O times the computer won MAKE A JUNIT test. Some functions that we've used that should be helpful are: assertEquals assertTrue assertFalse

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions