Question: You will use the Random function to write the following Java program. Write a program named Dice1.py. You are given two dices. Each dice has

You will use the Random function to write the following Java program. Write a program named Dice1.py.

  • You are given two dices.
  • Each dice has 6 faces and can generate a number between 1 and 6.

The minimum number generated by the two dice is 2 and maximum number is 12.

Throw the dice and if the number generated is less than or equal to 6 than you lose and if it is greater or equal to 9 than you win and if you get 7 and 8 then it is a tie. You will make use of Random function and a selection structure (if/else) to write the code.

Save the document as Dice1.java

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 Programming Questions!