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, 03.07.2019 15:10
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
question
Engineering, 04.07.2019 18:10
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
Answers: 1
question
Engineering, 04.07.2019 18:10
The thermal expansion or contraction of a given metal is a function of the f a)-density b)-initial temperature c)- temperature difference d)- linear coefficient of thermal expansion e)- final temperature f)- original length
Answers: 2
question
Engineering, 04.07.2019 18:10
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
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
Questions on the website: 13722360