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:20
Derive the correction factor formula for conical nozzle i=-(1+ cosa) and calculate the nozzle angle correction factor for a nozzle whose divergence hal-fangle is 13 (hint: assume that all the mass flow originates at the apex of the cone.
Answers: 3
question
Engineering, 04.07.2019 18:20
What is the heat treatment of metals? what is the benefit of it? why and how it's useful? answer in details, do not write by hand.
Answers: 3
question
Engineering, 04.07.2019 18:20
Wiy doeres rere okhn a pump whon working betwon the same pressure range?
Answers: 2
question
Engineering, 04.07.2019 19:20
Acircular pipe of 30mm outside diameter is placed in an airstream at 30 c and latm pressure. the air moves in cross flow over the pipe at 20 m/s, while the outer surface of the pipe is maintained at 110 c. what is the drag force exerted on the pipe per unit length? what is the rate of heat transfer from the pipe per unit length?
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
English, 09.01.2021 23:10
question
Health, 09.01.2021 23:10
question
Mathematics, 09.01.2021 23:10
question
Mathematics, 09.01.2021 23:10
question
Mathematics, 09.01.2021 23:20
question
Mathematics, 09.01.2021 23:20
question
Geography, 09.01.2021 23:20
Questions on the website: 13722361