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

16/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:

Homework Guru
Math Exam Success
Financial Analyst
Accounting & Finance Specialist
Quality Assignments
ECFX Market
Writer Writer Name Offer Chat
Homework Guru

ONLINE

Homework Guru

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.

$37 Chat With Writer
Math Exam Success

ONLINE

Math Exam Success

I have assisted scholars, business persons, startups, entrepreneurs, marketers, managers etc in their, pitches, presentations, market research, business plans etc.

$21 Chat With Writer
Financial Analyst

ONLINE

Financial Analyst

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
Accounting & Finance Specialist

ONLINE

Accounting & Finance Specialist

I have done dissertations, thesis, reports related to these topics, and I cover all the CHAPTERS accordingly and provide proper updates on the project.

$41 Chat With Writer
Quality Assignments

ONLINE

Quality Assignments

After reading your project details, I feel myself as the best option for you to fulfill this project with 100 percent perfection.

$38 Chat With Writer
ECFX Market

ONLINE

ECFX Market

I have written research reports, assignments, thesis, research proposals, and dissertations for different level students and on different subjects.

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

Exp19_excel_ch05_cap_apartments - Comida española tacos al aguacate tortilla como tostada - Module 05 Lab 02 - Unknown Strong Acid Lab/Questions and Concept Test - Journal - Breast milk lattes in seattle - Five characteristics of human service professionals - Library acquisition process flow chart - Chavez company most recently reconciled - Wilmington university apa template - Reflect on the need to improve outcomes in healthcare - What are the primary and secondary dimensions of diversity - Cry freedom donald woods quotes - Toucon collections - I am david book - Review - Daisy - Ieee communications surveys & tutorials abbreviation - Reading Strategies and Annotated Reference List Assignment - In the park gwen harwood themes essential energy network map - Chapter 6 mapping kelp forests inquiry activity answer key - Why you should drink more water persuasive speech - Functional Training Discussion - Experimental research - Basic steps for data mining process - Discussion board on Sula - 480 8th st ne naples fl 34120 - Essay about education should be free for everyone - Aoa network diagram examples - Miles converted into km - 5 regions of pennsylvania map - Project 1: Excel (Advanced Application Software) - Threaded 3 - Nursing presentation - 50-P1&P2 - The flowers by alice walker theme - Bus.com 1 - Levels of analysis framework - Lds young women handbook - Give me liberty chapter 8 review questions - Cliftonville integrated primary school - Neb prestained protein ladder - Sun sparc enterprise t5120 - Access module 3 sam project 1 - How to determine conductivity of a compound - Mass of empty 150ml beaker - Introduction to criminal justice chapter 2 review answers - Grant and Contract Proposal Writing – Week 5 - Anne bradstreet the author to her book - Acog guidelines for preeclampsia 2013 - Investigating the ph scale phet answers - Tenants union victoria contact - Carnivàle season 1 episode 12 - An ad for a soft drink that uses the slogan: "life is good" is employing _____. - Lit 103 - Police rotating shift schedule - In Money We Trust? Documentary and Money Book Analysis - Gender Identity - The computer workstation furniture manufacturing that santana rey - Owl english purdue edu owl resource 560 01 - Devon bishop age 45 is single - The history of american fire prevention from 1600 to 2000 - What relation is a doorstep to a doormat math answer - Sand is a mixture - Optics Lab - Barker company has a single product called a zet - Urinary system case study answers - Nursing diagnosis of ineffective airway clearance - Literature Review and Critical Appraisal. - The body keeps the score workbook pdf - Project - Acct - Caco3 hcl balanced equation - Karen marley janet bowen - In his comedies shakespeare is well known for - Burn her monty python - Wheel of fortune sextet nyt crossword - Toll v alphapharm case summary - Speech - NRS 451-VN-0501 Nursing Leadership - Tax file declaration question 9 - Tom and jerry slicked up pup vimeo - Sir gawain and the green knight pdf simon armitage pdf - Integral of tan x - Powerflex 753 wiring diagrams - World of rolling stones bootlegs - Bourke high school staff - Alabama moon book summary - Ib biology cellular respiration exam questions - Carol kuhlthau information search process - Policy/Regulation Fact Sheet - History - How are plant assets reported on the balance sheet - Scholarly activity summary example - Specific heat capacity of polystyrene - Ibm color blind palette - Pembina ground disturbance quiz answers - Advanced higher modern studies - Write about the Seneca falls declaration ( fall all the requirements in the pictures I have attached below - Gale force surfing case study - An apology for raymond sebond