I have created a string array called teams and an int array called nums. Each integer in the num array corresponds to a team in the string array.
Ex:
Montreal Canadiens = 1, Chicagao Blackhawks = 2, etc.
I need to randomly pick numbers from 1-10 (corresponding to int[] num) and this loop must continue until each element in the integer array is called once. Meaning byt the end of the loop, each team in the string array is called on once. This must be done through a while loop. I can't seem to figure out how to exactly create a loop that would do this.
import java.util.Scanner;
public class Question1 {
public static void main(String[] args) {
//declare scanner
Scanner keyboard= new Scanner (System.in);
//display opening message
System.out.println("= 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 =");
System.out.println("= 0 0 =");
System.out.println("= 0 NHL Miniature Hockey Puck Vending Machine 0 =");
System.out.println("= 0 0 =");
System.out.println("= 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 = 0 =");
System.out.println("");
System.out.println("");
System.out.println("Hello, what is your first name? ");
//read user input
String name = keyboard.nextLine();
//Welcome message
System.out.println("Welcome " + name + "! Let's see how much money you will need to spend to get all of the pucks.");
//declaring 10 teams in a 1D array
String[] teams = {"Montreal Canadiens","Chicago Blackhawks","Boston Bruins","Toronto Maple Leafs","Vancouver Canucks","Ottawa Senators","Pittsburgh Penguins","Calgary Flames","New York Rangers","Edmonton Oilers"};
int[] nums = {1,2,3,4,5,6,7,8,9,10};
//random number from 1-10
while (
int RandomNum = (int)(Math.random()*10)+1;