Assignemnt #130: Making Arrays
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: MakingArrays
/// File Name: MakingArrays.java
/// Date Finished: 2/25/2016
import java.util.Random;
public class MakingArrays
{
static Random rng = new Random();
public static void main(String[] args)
{
int[] randomIntArray = new int[5];
for (int x = 0; x < 5; x++)
randomIntArray[x] = rng.nextInt(10) + 1;
System.out.println("\n" + randomIntArray[0] + " " + randomIntArray[1] + " " + randomIntArray[2] + " " + randomIntArray[3] + " " + randomIntArray[4]);
String[] wordYo = {"Dank", "beats", "run", "deep"};
System.out.println("\n" + wordYo[0] + " " + wordYo[1] + " " + wordYo[2] + " " + wordYo[3] + ".\n");
}
}
Picture of the output