Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using java and no loops 3. Write a Java program that plays the kids' game rock-paper- scissors (RPS). Assume scissors win vs. paper, paper wins

image text in transcribed
using java and no loops
3. Write a Java program that plays the kids' game rock-paper- scissors (RPS). Assume scissors win vs. paper, paper wins vs. rock and rock wins vs. scissors. The program randomly generates an int among the values {0, 1, 2} representing rock, paper, and scissors, respectively. The program prompts the user to enter a value 0, 1 or 2 and then displays a message on who has won, based on the RPS game rules above. Should both the user and the program pick the same choice, the game is tied (i.e., nobody won). Show the output of your game for five different choices of play (computer, user) where each of computer and user is one of 0, 1 or 2. (For example, (0, 1) means computer played rock and user played paper, so the user would win in that scenario.) NOTE: since we will have covered the char datatype in the meantime, feel free to use e.g. char R, P, S instead of int 0, 1, 2 if you'd like (optional)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

LO2 Explain the major laws governing employee compensation.

Answered: 1 week ago