Question: Simulating a dice ro11, values between 16 Random gen = new Random (); ht diceRoll = gen.nextint (7); System.out.println(Dice rol1; + diceRoll); 3witch (diceRol1
Simulating a dice ro11, values between 16 Random gen = new Random (); ht diceRoll = gen.nextint (7); System.out.println("Dice rol1; " + diceRoll); 3witch (diceRol1 z 2) ( case 0: System.out.println ("You rolled an odd number. "); break; case 1: System.out.println("You rolled an even number. "); break; For the code above: 1. What is the program trying to do? (5 points) 2. Are there any problems that you notice in this code? What are they? (10 points) 3. If there are issues, fix them and submit the fixed code in Lab5_bonus.java (15 points) 4. After fixing your code, within the switch statement, if the number is odd, create another random number within the range 0 to 50 . Then first multiple this random number to the diceRoll then add it. If the result of this operation is divisible by 3, print "I earned the bonus points" otherwise print "I still earned the bonus points". (20 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
