Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing a rock paper scissors game in Java using the arrow syntax for the switch statement ( example case 1 - >

I need help writing a rock paper scissors game in Java using the arrow syntax for the switch statement (example case 1->) not the full rule syntax for the switch statement (example case 1:). Again use the arriw syntax (case ->) nit the full rule syntax (case :). The orogram should use methods frim the JOptionPane class. The program should ask the player to make their selection from the dialog box. The dialog box should have buttons with 3 buttons. One button should say Rock, one should say Paper, and the other should say Scissors. It should say click a button corresponding to your pkay. The player will click a button. A dialog box will display what the player selected. Next the program will generate a choice for the computer. Once the computers choice is generated the program should translate the computers choice. Next the program should display a dialog box with the results. Example is "You chose scissors. The computer chose paper. Scissors cut paper. Yoy win!". There should be 7 options for results. Paper wraps rock when the player wins or the computer wins; Rock crushes scissors when the player wins or computer wins; Scissors cut paper when the player wins or the computer wins. The final dialog box should display the final score of the game by saying Wins: , Loses: , Ties: . The program should have a loop to repeat the game for 3 rounds before ending the game. Again the program should use the arrow syntax (case 1->) not the full rule syntax (case 1:) for the switch statement.

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions