Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. public void diceRollerGame() { 2. printing Traveler, welcome to the dice roller easter egg game); 3. System.out.println(It appears you are bored. Why don't you

image text in transcribed
image text in transcribed
1. public void diceRollerGame() { 2. printing Traveler, welcome to the dice roller easter egg game"); 3. System.out.println("It appears you are bored. Why don't you roll some dice."); System.out.print Please enter the number of sides on your dice: "); 5. String strSides - getPlayersChoiceO; // this can be safe to assume is correct 6. System.out.print("Please enter the number of times you wish to roll your dice: "); 7. String strTimes = getPlayers ChoiceO 4. 8. 9. int sides - Double.parseInt(strSides); int times - Integer.parseInt(strTimes); 10. 11. int counter - @; int computerCounter - 180 12. 13. 14. 15. 16. for(int i - 0; i ComputerCounter / times) { System.out.println("You won!"); } else { System.out.println("Sadly, your imaginary computer won! :"): } 25 26. 27.) 28. public int rolldice(int numberOfSides) { 29. int rand - Cint)(Math.random()*108); 30. return Crand / numberOfSides) + 1; 31.) I apologize the answer numbers are shuffled. Canvas would not let me turn off shuffling for this question. You can safely assume that if a number isn't found, there isn't an error on that line - but all line numbers are indeed represented (especially the ones with errors). My suggestion would be to write down the lines with errors on a piece of paper, and then go in and mark them all. Please note that there are 10 errors to be found in the code above, and 10 points to this Stisn't an error, canvas takes off a point - so choose carefully 2 30 12 13 31 3 15 24 9 23 017 20 18 16 29 10 25 28 26 22 E5 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago