ITEC 120 LAB 16 | Back to Lab index page |
Rolling Dice
Write a driver which will instantiate and roll four die objects. Use the die class: Die.java.
Print each roll, along with which roll it is.
Roll the dice until all 4 dice are the same, and count how many rolls that took and report it at the end. (Note: It will usually take many more than 8 rolls for the dice to be the same.)
Sample run:
Program displays: |
Roll 1: 3
4 4
4 It took 8 rolls for the dice to be the same! |