Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.*; public class RPS { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int user = 0, pc = 0; var games

image text in transcribed

import java.util.*; public class RPS { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int user = 0, pc = 0; var games = new ArrayList(); char[] outcomes = {'R','P','S'}; while(user pc) System.out.println(" The user wins!:D"); else{ System.out.println(" The computer wins!;)"); } } }

// the above java code is from my previous HWK4 part (B) assignment

//Please Do Not use arrays in this problem. Thank you

//Can someone please help me with this problem? Thank you

//Please use comments so I can understand it better from my end

Use methods to re-do the R, P, S problem from HW3 -- see Problem 4, part b). Put a single RPS game play into a separate method, called from main. You keep track of the score (how many games won by each player) in main; eventually, in main, you recognize one player has won 3 games, you terminate the match, and report who won, by which final score insofar as won vs. loss games, and after how many games total (including ties). NOTE: in this problem, like in Problem 3, use of methods is required (i.e., use of methods is mandatory, not 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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions