HughesElite

Untitled

May 4th, 2021
612
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. public class ConfigTestArea
  5. {
  6.     public static void main(String[] args)
  7.     {
  8.         ConfigTestArea Obj = new ConfigTestArea();
  9.         Obj.go();
  10.  
  11.     }
  12.    
  13.     public void go()
  14.     {
  15.         Scanner scan = new Scanner(System.in);
  16.         Random rand = new Random();
  17.         int diceOneInt =1;
  18.         int diceTwoInt =1;
  19.        
  20.         System.out.println("How many sides does the first dice have?");
  21.         diceOneInt = scan.nextInt();
  22.        
  23.         System.out.println("How many sides does the second dice have?");
  24.         diceTwoInt = scan.nextInt();
  25.         scan.close();
  26.        
  27.         int diceOneRandomA = rand.nextInt(diceOneInt) +1;
  28.         int diceTwoRandomA = rand.nextInt(diceTwoInt) +1;
  29.         System.out.println("Dice 1 first roll is " + (diceOneRandomA));
  30.         System.out.println("Dice 2 first roll is " + (diceTwoRandomA));
  31.            
  32.         int diceOneRandomB = rand.nextInt(diceOneInt) +1;
  33.         int diceTwoRandomB = rand.nextInt(diceTwoInt) +1;
  34.         System.out.println("Dice 1 first roll is " + (diceOneRandomB));
  35.         System.out.println("Dice 2 first roll is " + (diceTwoRandomB));
  36.        
  37.         int diceOneRandomC = rand.nextInt(diceOneInt) +1;
  38.         int diceTwoRandomC = rand.nextInt(diceTwoInt) +1;
  39.         System.out.println("Dice 1 first roll is " + (diceOneRandomC));
  40.         System.out.println("Dice 2 first roll is " + (diceTwoRandomC));
  41.        
  42.         System.out.println((diceOneRandomA + diceTwoRandomA + diceOneRandomB +
  43.                 diceTwoRandomB + diceOneRandomC + diceTwoRandomC) /6 );
  44.     }
  45.  
  46.        
  47. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×