Last active
April 2, 2019 18:03
-
-
Save MelanieS/d65c29524091f105d7dbcfb218cda42f to your computer and use it in GitHub Desktop.
RollingDie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package rollingdie; | |
import java.util.Random; | |
import java.util.Scanner; | |
import java.util.*; | |
import java.util.Arrays; | |
/** | |
* | |
* @author mshebel | |
*/ | |
public class RollingDie { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
Random rand; | |
rand = new Random(); | |
Scanner input = new Scanner(System.in); | |
System.out.println("Enter array size:"); | |
int arrSize = input.nextInt(); | |
int[] myRoll; | |
myRoll = new int[arrSize]; | |
for (int i = 0; i < myRoll.length; i++) { | |
myRoll[i] = rand.nextInt(6)+1; | |
} | |
System.out.println(Arrays.toString(myRoll)); | |
} | |
// TODO code application logic here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment