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

04/01/2021 Client: saad24vbs 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:

University Coursework Help
Helping Hand
Top Essay Tutor
Writer Writer Name Offer Chat
University Coursework Help

ONLINE

University Coursework Help

Hi dear, I am ready to do your homework in a reasonable price.

$62 Chat With Writer
Helping Hand

ONLINE

Helping Hand

I am an Academic writer with 10 years of experience. As an Academic writer, my aim is to generate unique content without Plagiarism as per the client’s requirements.

$60 Chat With Writer
Top Essay Tutor

ONLINE

Top Essay Tutor

I have more than 12 years of experience in managing online classes, exams, and quizzes on different websites like; Connect, McGraw-Hill, and Blackboard. I always provide a guarantee to my clients for their grades.

$65 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

Greatest physical threat to information systems - Literary devices in bohemian rhapsody - Php programming with mysql comprehension check answers - Philosophy - TLMT318 Week 3 Research Paper Topic - Annotated bibliography university of phoenix - Words with the prefix sept - Clean kitchen premises and equipment assessment - Load rite 5 starr trailer - Mrs henderson windmill theatre - Brisbane correctional centre postal address - What is an equilateral parallelogram - Non sequitur examples in commercials - What is fatuous love - University of notre dame general regulations - Putt putt boat plans - Illi commercial real estate - Ted talk sociology - Wk3discus/sh - Describe a stationary front - Nohs ethical standards for human service professionals - Quartus pin assignment tutorial - Compute stefani's total standard cost per unit - Glenn colquhoun bred in south auckland - Risk Management in Healthcare Setting Week 4 Discussion - Electronic thermometer using op amp - Bookkeeping bookkeeping services engagement letter sample - Aifs hedging case solution - 25 50 75 a dollar song - Japanese studies oxford brookes - Swot analysis eyewear industry - Maths genie surds answers - Reflective practice journal template - Sphygm o medical term - Sonnet in primary colors analysis - Splitting field of irreducible polynomial - Informative speech critique example - The rational theologies of the early 1800s emphasized - Red bull wall to wall production - Greenough hamlet cafe menu - Nutrition and weight status powerpoint - Publix strawberry peach sensation cake calories - A company that pursues and achieves strategic objectives - How to complete a triage assessment form - Ocr nationals ict level 2 - Examples of centripetal and centrifugal forces - Marathon dim sims coles - Pico questions related to emergency nursing - Similarities and differences questions and answers - Bta16 600b application notes - 30 days frank george immigration - Trauma disorders in the media and Anxiety Disorders in the Media - Vassarstats chi square test - How many ml is a teaspoon of medicine - Presentation on email and wifi policies - Psychology lecture notes pdf - Topics of interest - Scatter plot guided notes - Www teamviewer com en download index aspx - Http www padowan dk graph - Corporate finance case studies and solutions - How to find final temperature using specific heat - Wendell berry the pleasures of eating summary - Taco bell employee handbook 2019 - Input output analysis questions and answers - Developing Organizational Policies and Practices - Hpi soap note example - Epidemiology Case 3 - Cuckoo's Book Analysis - Against school john taylor gatto rhetorical analysis - Third party policies and billing guidelines - Monthly standard deviation of s&p 500 - Organ leader and decision making - Racism it stops with me evaluation - Intellicare accredited hospitals in makati - Which of the following statements is not true concerning field research? - 3 PAGES(MKT/574 paper due 20 HOURS) - HOMEWORK(AG) - What happened to the dallas sheep rancher worksheet answers - Starwood hotels and resorts worldwide inc 2007 case study - Psnc flu consent form - How did ernest hemingway kill himself - English - Full wave bridge rectifier using scr - Proscenium arch stage diagram - Amir's guilt in the kite runner quotes - Norton introduction to literature shorter 13th edition pdf - Phet simulations physics electricity - Dupont gevity - Reduction of camphor with sodium borohydride - 5 w's of post op fever - Ergonomics and anthropometrics meaning - Course project Quality control - Iturralde v hilo medical center usa summary - Adelaide central bus station 85 franklin street - Compare Decolonization in Africa (Plagiarism Checked) Submit Assignment - write a minimum two to three-page paper about a successful organization that is dedicated to being a learning organization. - International journal of offshore and polar engineering - Ucd medicine degree title - MTH/110 Week 2 Discussion