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 algorithm

26/10/2021 Client: muhammad11 Deadline: 2 Day

Java Programming 5

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:

Top Grade Tutor
Engineering Solutions
George M.
Isabella K.
Accounting & Finance Specialist
Accounting Homework Help
Writer Writer Name Offer Chat
Top Grade Tutor

ONLINE

Top Grade Tutor

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.

$49 Chat With Writer
Engineering Solutions

ONLINE

Engineering Solutions

As an experienced writer, I have extensive experience in business writing, report writing, business profile writing, writing business reports and business plans for my clients.

$16 Chat With Writer
George M.

ONLINE

George M.

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$21 Chat With Writer
Isabella K.

ONLINE

Isabella K.

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

$18 Chat With Writer
Accounting & Finance Specialist

ONLINE

Accounting & Finance Specialist

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

$15 Chat With Writer
Accounting Homework Help

ONLINE

Accounting Homework 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.

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

How to reference aasw practice standards - Introduction to statistics final exam - Excel qm linear programming - MATH - Shape of the state of nevada - Project kickoff meeting powerpoint presentation - 1z0 071 exam dumps - Diversity - What is alton towers mission statement - Valley of ashes great gatsby - How is data used to evaluate outcomes - Hurley silhouette 17 bilge keel - Clbr3 polar or nonpolar - Thomas friedman ted talk - Japan single payer - Implement a hexadecimal calculator for iOS. - Collaborated with your group - What's 3.33 as a fraction - Fantastic mr fox badger - Urgent, urg - BUS 627 FINAL ASSIGNMENT - Cobalt chloride equilibrium - The influence of leadership - Positioning presentation mkt 421 - Borderline personality disorder - Jlg analyzer level 1 code - Presentation - American national government - Ethical decision making in project management - Philosophy Plato - Transforming Rational Functions - 2 methylpropene + hbr - 8 bit signed binary converter - What account normally has a credit balance - Human biology preclinical curtin handbook - Autocount chapter 10 assignment 2 answer - Biometrics powerpoint presentation - Introduction of color sorting machine - Exercise 3.1 - Space station sightings tonight nz - ETCM-Research-4 - High low method equation - Sun microsystems case study valuation - Cirque du soleil headquarters tour - Descriptive paragraph about food - Dynamic nursing - A risky asset can have a ____ beta. - Jamie eason phase 2 day 1 - Effective training systems strategies and practices pdf - Calcium plus hydrochloric acid - Yanjan new material india private limited - Predominant phagocyte of early inflammation - Psy 410 week 2 worksheet - Strategic factor analysis summary sfas - Additivity of heats of reaction - Relationship of pressure and volume - Yehoram gaon shalom lach eretz nehederet - Prejudice in montana 1948 - HIST 101 National Archives Assignment - Mrs johnstone quotes and analysis - Emily dickinson we grow accustomed to the dark meaning - Creating a company culture for security design document - Qualitative analysis of group 4 cations lab report - Catherine helen motter vet - Geopolitical community in which a person would live - Sustainability management - Diablo 2 lod quests - Mbo blood pressure monitor instructions - Finance discussion 8 - Beer lambert equation units - Nervous system concept map answers - Themes in goodnight and goodluck - Direct and partial variation - Bud light brand positioning - Opera front office system - Hamlet acquires a year class asset on - Personal Statement - Health psychology theory research and practice 4th edition - Abbott point of care clew update - Orthodontic instruments study guide - Este fin de semana los excursionistas (hikers) (1) - Latvian song and dance festival 2013 - Coil machine set up - Navy e6 midterm examples - Nutrition Therapy Strategies for Wound Healing - How did bohr improve rutherford's model - Work 1 - Meraki sd-wan design guide - Product of x and y - Unit 4 Discussion 1&2 - Some lessons from the assembly line by andrew braaksma - University of rhode island change assessment scale - Piper warrior ii cockpit layout - Http www teachingamericanhistory org neh interactives sectionalism lesson1 - Sir charles gairdner hospital address - Help me with homework answers - Anybody's guide to total fitness 11th edition ebook - Accounting business reporting for decision making 6th edition solutions - Discussion - Blue eyes and brown eyes experiment video