Advertisement
kamandos

HW3

Jun 27th, 2022
792
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Dice {
  2.    
  3.     public static void main(String[] args) {
  4.    
  5.         int die1;  
  6.         int die2;  
  7.         int roll;  
  8.        
  9.         die1 = (int)(Math.random()*6) + 1;
  10.         die2 = (int)(Math.random()*6) + 1;
  11.         roll = die1 + die2;
  12.        
  13.         System.out.println("The first die comes up " + die1);
  14.         System.out.println("The second die comes up " + die2);
  15.         System.out.println("Your total roll is " + roll);
  16.  
  17.     }  
  18.  
  19. }  
Advertisement
RAW Paste Data Copied
Advertisement