Engineering
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()
{

}
}

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, DestyHilBan1183
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
image
Engineering, 04.07.2019 18:10, lowkeyqueenk
Apipe with an outside diameter of 15 cm is exposed to an ambient air and surrounding temperature of -20°c. the pipe has an outer surface temperature of 65°c and an emissivity of 0.85. if the rate of heat loss from the pipe surface is 0.95 kw per meter of length, the external convective heat transfer coefficient (h) is: (a) 12.5 w/m"k (b) 18.6 w/mk (c) 23.7 w/mk (d) 27.9 w/mk (e) 33.5 w/mk
Answers: 1
image
Engineering, 04.07.2019 18:20, sarah7984
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 18:20, 1230bering
Select any two (2) areas of applications of chain-drive. (clo4) a)-permanent lubrication necessary b)-hydraulic forklift truck operation c)-rigging and heavy moving materials d)-relatively high maintenance costs e)-costlier than belt drives
Answers: 2
Do you know the correct answer?
In this problem, you’ll play a simple rock, paper, scissors
game. first, you’ll ask the user t...

Questions in other subjects: