Write a findwinner method that takes in two moves

Assignment Help Computer Engineering
Reference no: EM132076123

I need some help on my java project, this is just a part of it. **When you answer this question please follow the instructions.**

Write a JAVA class (Rock, Paper, Scissors Game) that represents the game.

This class only represents the game.

This class does not interact with the user at all.

The RPSGame object is described by three characteristics. These are the instance data variables:

number of computer wins

number of user wins

number of ties

Include appropriate getters and setters.

Include constants or an enum to represent the possible moves (rock, paper, or scissors) and the possible outcomes of a single round (user win, computer win, or tie).

Use these constants/enum to make your code more readable.

For example, if you are using ints to store the moves, it's more clear to test whether userMove==ROCK or userMove==Moves.ROCK rather than userMove==1.

If you don't use an enum, you can decide what type of data to use for the constants (String, int, or something else).

Write a generateComputerPlay method that generates a random move by the computer.

Write a findWinner method that takes in two moves as parameters (the user move and the computer move) and determines the outcome (user wins, computer wins, or tie).

Determining the winner will require you to compare a lot of possible match-ups through a series of nested conditionals.

The method should update the instance data (number of computer wins, number of user wins, and number of ties) depending on the outcome.

Reference no: EM132076123

Questions Cloud

Calculate new dimensions for the textdraw panel : Calculate and save the difference between the two in both the height and width dimensions.
Create an array that holds hundred integers : Write a complete method (including a full method header) called contains.Create an array that holds 100 integers
Find values for the parameters a and p : a. Find values for the parameters a and P. b. State the initial quantity and the percent rate of growth or decay.
Find the indicated probability : Suppose that X has a normal distribution. Find the indicated probability. The mean is 15.2 and the standard deviation is 0.9. Find the probability that X is gre
Write a findwinner method that takes in two moves : Determining the winner will require you to compare a lot of possible match-ups through a series of nested conditionals.
Determine its radius r and length h if the trough : Determine its radius r and length h if the trough is to require the least material for its construction.
Write a program that implements and tests of two functions : Write a c++ program that implements and tests the following two functions related to the Calkin-Wilf enumeration of the positive fractions.
What is the length of the diameter : 1. Points (-7, 6) and (3,8) are endpoints of the diameter of a circle. A. What is the length of the diameter (simplify)
How many noninverting buffers would be required : If this memory were expanded to 16 4-bit word how many inverting buffers (NOT gates) would be required?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd