Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch6ex14;
- import java.util.Random;
- public class Ch6Ex14
- {
- public static void main(String[] args)
- {
- System.out.println("Dice1\tDice2\tTotal");
- Random generator=new Random();
- int total, dice1, dice2;
- for(int c=0;c<5;c++)
- {
- dice1=generator.nextInt(6)+1;
- dice2=generator.nextInt(6)+1;
- total=dice1+dice2;
- System.out.println(dice1+"\t"+dice2+"\t"+total);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement