Write an interactive program that allows 1 person to play this game against the computer. Input This program has two types of input:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 5GZ
icon
Related questions
icon
Concept explainers
Question

Children often play the game of rock, paper, and scissors. This game has two players, each of whom chooses one of the three objects: rock, paper, or scissors. If player 1 chooses rock and player 2 chooses paper, player 2 wins the game because paper covers the rock. The game is played according to the following rules:

  • If both players choose the same object, this play is a tie.
  • If one player chooses rock and the other chooses scissors, the player

choosing the rock wins this play because the rock breaks the scissors.

  • If one player chooses rock and the other chooses paper, the player

choosing the paper wins this play because the paper covers the rock.

  • If one player chooses scissors and the other chooses paper, the player

choosing the scissors wins this play because the scissors cut the paper.

Write an interactive program that allows 1 person to play this game against the computer.

Input This program has two types of input:

  • The users’ responses when asked to play the game.
  • The players’ choices.

Output The players’ choices and the winner of each play. After the game is over, the total number of plays and the number of times that each player won should be output as well. (programming language is C#)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole