subject
Engineering, 22.01.2020 04:31 jyepez

In this problem, you’ll play a simple rock, paper, scissors
game. first, you’ll ask the user to pick rock, paper, or
scissors.

then, you’ll have the computer randomly choose one of the
options.

after that, print out the winner! you should keep playing the game until the user hits enter.

note: you’ll need to implement a method called
string getwinner(string user, string computer). luckily,
you just wrote that in an earlier program!

here is a sample run of the program.

enter your choice (rock, paper, or scissors): rock
user: rock
computer: paper
computer wins!
enter your choice (rock, paper, or scissors): paper
user: paper
computer: scissors
computer wins!
enter your choice (rock, paper, or scissors): scissors
user: scissors
computer: paper
user wins!
enter your choice (rock, paper, or scissors): rock
user: rock
computer: rock
tie
enter your choice (rock, paper, or scissors):
for playing!
public class rockpaperscissors extends consoleprogram
{
private static final string user_player = "user wins! ";
private static final string computer_player = "computer wins! ";
private static final string tie = "tie";

private string getwinner(string user, string computer)
{

}

public void run()
{

}
}

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Hydraulic fluid with a sg. of 0.78 is flowing through a 1.5 in. i.d. pipe at 58 gal/min. the fluid has an absolute viscosity of 11.8 x 105 lbf-sec/ft2. is the flow laminar, turbulent or within the critical range? give both a numerical reynolds number and a term answer.
Answers: 3
question
Engineering, 04.07.2019 18:10
Which from the following instrument is commonly used to detect the high pitch butzing sound in bearings? [clo4] a)-digital ultrasonic meter b)-infrared camera c)-spectroscopic d)-vibrometer
Answers: 2
question
Engineering, 04.07.2019 18:20
An engine runs on the ideal diesel cycle. the cycle has a compression ratio of 20 and a cutoff ratio of 2. the highest temperature in the cycle is 1200 k. if the heat into the system is 300 kj/kg of working fluid and using variable specific heats determine the work produced per mass of working fluid
Answers: 3
question
Engineering, 04.07.2019 18:20
Modern high speed trains do not have perpendicular expansion gaps where rails are joined end-to-end any more they are mostly welded together but what might happen if there was a spell of particularly hot weather that causes inspection of the tracks?
Answers: 1
You know the right answer?
In this problem, you’ll play a simple rock, paper, scissors
game. first, you’ll ask the user t...
Questions
question
World Languages, 10.01.2022 14:00
question
Mathematics, 10.01.2022 14:00
question
English, 10.01.2022 14:00
Questions on the website: 13722367