Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Rock paper scissors lizard spock java program code

27/11/2021 Client: muhammad11 Deadline: 2 Day

CPS 150 Programming Assignment 5: RPSLS (Rock, Paper, Scissors, Lizard, Spock)

Update the Rock, Paper, Scissors program you wrote for Lab Project 14 so that it plays RPSLS.
The Rules for RPSLS are described by Dr. Sheldon Cooper on The Big Bang Theory (also quoted below), and shown in the diagram on the right.

Scissors cuts paper, paper covers rock, rock crushes lizard, lizard poisons Spock, Spock smashes scissors, scissors decapitates lizard, lizard eats paper, paper disproves Spock, Spock vaporizes rock, and as it always has, rock crushes scissors.

RPSLS Features (Updates):

· The user input should be text, not numerical (e.g., "rock" not 1). It should also be case-insensitive (see the Sample Run, below).

· Suggestion: use the Scanner method nextLine() instead of the Scanner method next() for user input.

· Suggestion: to minimize re-write of your existing code, "translate" the user input into one of five values (there are three in the original program);

· a good way to do this is to define and call a method static int textToNumber(String choice) .

·

· After each round, the user is prompted as to whether they want to play again (i.e., yes or no).

· Suggestion: only play again if the user enters yes; otherwise, end the game.

· Suggestion: use the Scanner method nextLine() instead of the Scanner method next() for user input.

·

· For each round, the user input of choice should be validated as one of the five valid choices; anything else causes the round to be forfeited and prompts the user as to whether they want to play another round.

· Suggestion: define a method static boolean isValid(String choice) and call it with the user choice as an if condition.

·

· You will have to add methods for the two new choices that the user can make:

· int lizardChoice(int computerChoice)

· int SpockChoice(int computerChoice)

· As with the original three methods, each of these two new methods returns one of the three named int constants PLAYER1_WINS, PLAYER2_WINS, or DRAW.

·

· You will also have to re-define (expand) the code in the original three methods rockChoice, paperChoice, and scissorsChoice to check whether the computer chose either of the two new choices (i.e., lizard or Spock).

Sample Run (user input in color):

run:

Welcome to the game of Rock Paper Scissors Lizard Spock

Here are the rules:

Scissors cuts Paper

Paper covers Rock

Rock crushes Lizard

Lizard poisons Spock

Spock smashes Scissors

Scissors decapitates Lizard

Lizard eats Paper

Paper disproves Spock

Spock vaporizes Rock

(and as it always has) Rock crushes scissors

Ready? Then let's begin!

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): rock

OK, you chose rock

Player 2 (computer) chooses rock

It's a draw

Play again (yes/no)? yes

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): spock

OK, you chose spock

Player 2 (computer) chooses lizard

Lizard poisons Spock; Player 2 wins

Play again (yes/no)? yes

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): banana <--- invalid input

Invalid choice "banana"; try again.

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): Paper

OK, you chose paper

Player 2 (computer) chooses scissors

Scissors cut paper; Player 2 wins

Play again (yes/no)? yes

Player 1, enter your choice ( rock, paper, scissors, lizard, spock ): <--- invalid input (empty string)

Invalid choice ""; try again.

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): SCISSORS

OK, you chose scissors

Player 2 (computer) chooses paper

Scissors cut paper; Player 1 wins

Play again (yes/no)? yes

Player 1, enter your choice ( rock, paper, scissors, lizard, Spock ): lIZARD

OK, you chose lizard

Player 2 (computer) chooses scissors

Scissors decaptiate lizard; Player 2 wins

Play again (yes/no)? no

BUILD SUCCESSFUL (total time: 1 minute 30 seconds)

--------------------------------------------------------------------------------------------

Assignment Grading (for each method):

· (Updated) Contract: 10%

· (Updated) Purpose Statement: 10%

· (Updated) Examples: 10%

· (Updated) Algorithm: 10%

(Updated) Method Code: 60%

What Do I Hand In?

Once you are done, upload the source code file (i.e., .java file) for your NetBeans project.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Essay Writing Help
Assignment Guru
Smart Homework Helper
Coursework Help Online
24/7 Assignment Help
Top Class Engineers
Writer Writer Name Offer Chat
Essay Writing Help

ONLINE

Essay Writing Help

I am an elite class writer with more than 6 years of experience as an academic writer. I will provide you the 100 percent original and plagiarism-free content.

$47 Chat With Writer
Assignment Guru

ONLINE

Assignment Guru

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$23 Chat With Writer
Smart Homework Helper

ONLINE

Smart Homework Helper

I am a PhD writer with 10 years of experience. I will be delivering high-quality, plagiarism-free work to you in the minimum amount of time. Waiting for your message.

$34 Chat With Writer
Coursework Help Online

ONLINE

Coursework Help Online

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$31 Chat With Writer
24/7 Assignment Help

ONLINE

24/7 Assignment Help

Being a Ph.D. in the Business field, I have been doing academic writing for the past 7 years and have a good command over writing research papers, essay, dissertations and all kinds of academic writing and proofreading.

$15 Chat With Writer
Top Class Engineers

ONLINE

Top Class Engineers

I find your project quite stimulating and related to my profession. I can surely contribute you with your project.

$38 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Action camera market share 2016 - Strong acid and strong base net ionic equation - Product life cycle theory of fdi - Qualitative analysis of group 1 cations conclusion - Csi wildlife analyzing genetic evidence answers - Mcgraw hill accounting chapter 10 answers - Econ - Focused exam cough danny rivera - Quotes about john proctor - How to get the odd mushroom in ocarina of time - Module 08 Quiz - Field Experience Paper (CRJ 110) - Full sail university transcript request - Principles of incident response and disaster recovery 2014 pdf - Mikrotik switch trunk port - Analyzing Parametric Statistics - Cereal box marketing project - Visual basic programming exercises - Baby bunting hoppers crossing car seat fitting - Lifewell peer support training - 2 22 elizabeth street noosaville - As nzs 3500 free download - What does y represent - Geography stage 6 syllabus - Emerson climate technologies control board - Who distributes honest tea - Www householdresponse com teignbridge - What did henry luce and henry wallace have in common - Grand strategy business - Kathy schwalbe information technology project management eighth edition pdf - Educational seminar invitation template - Rewrite paper - 20 mcclelland street willoughby - I want someone to help me in a programming task - Messner's cage key wow - Essay - Psychology - Staples color copy price - The crucible play characters - 4. what else might be in the ethanol/aqueous interface? how could you eliminate this? - DQ - Samsung wireless ip phone - Wk 1 dis 6052 - Thames view infant school - Assessing Performance - 3 16 tap drill size in mm - Light vs darkness archetype - Patient-Centric Health Care Practices - Explain how this employment is directly related to your field of study * - HAINES PAPER ASSIGNMENT FOR USASMA - Sodium carbonate and phenolphthalein reaction - Altistart 22 olf fault - Sociology - ????ℂ???? ℝ????????????????????????????: ???????????? ???????????????? ???????????????????????????????? ????????????????????????????? - Film study worksheet for a work of historical fiction answers - Morris company applies overhead based on direct labor costs - Application of trapezoidal rule in engineering - Vygotsky 4 stages of development - Mcdonald's is which type of supply chain partner to gavina - PS490 Assignment 5 - RDBMS CONCEPTS - Planet fitness deals march 2018 - Because of their doctrine of ahimsa jains are - Wuthering heights chapter quizzes - Accounting chapter 8 1 application problem answers - The world of tolkien david day costco - Understanding Digital Identity Formation - The normans in ireland worksheets - How many died on hacksaw ridge - A4c6 - Describe your neighborhood paragraph - The wheel of retailing concept - Montserrat gcse case study - Control plan format 4th edition - Quote unquote leeds beckett - MBA - Main - Activity 3 - Mt540 swift message definition - Native bees blue mountains - Was the thane of cawdor a traitor - To what amount will the following investments accumulate - Baking soda and vinegar limiting reactant lab answers - Introduction to Philosophy - Camm2 data manager jobs - Peterhead to aberdeen bus times 61 - Lección 3 la familia answers - Corporate IT Security Audit Compliance - What is selective exposure in marketing - Assignment 1 (BA 616 - Business Ethics) - Assessment drives learning miller - Managerial economics - Simplify each radical expression use absolute value symbols - What is the magnitude f of the force? express your answer numerically in newtons. - Rank the acids from strongest to weakest - Peng m and k meyer international business pdf - Possible conflict management and negotiation techniques - Film segmentation example - The direction of east in mils is - Application process flowchart - Intermediate accounting chapter 23 statement of cash flows solutions - Richmond regent twin cinema