Question: Part 1 (5 points) First player: Rolling 2 random dice Write code using Random to simulating rolling two random dice. You should get two random

 Part 1 (5 points) First player: Rolling 2 random dice Write
code using Random to simulating rolling two random dice. You should get

Part 1 (5 points) First player: Rolling 2 random dice Write code using Random to simulating rolling two random dice. You should get two random values from 1 to 6 and store them in variables die1 and die2. Print those variables like this: First player's roll is 2 4 Since it is using Random, it should get different results every time you run it. Run your program several times to make sure you can get all values from 1 to 6. Part 2 (5 points) Swaping so first die is the higher value Use an if statment to compare the two dice, and, if necessary, swap the values in die1 and die2. Note: to swap 2 values you will need a third temporary variable to hold one of the values and 3 assignment statements (like: temp = a; a b; b = temp;). Move your printing code to the end of the program and again test it several times. It should now look like this: First player's roll is 4 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!