ok I tried this at school so I don't have acccess to my compiler but you could try something like this. I know it may not be the most efficient and it is certainly not full proof.

public class vend
{
public static void main(String[] args)
{
int [] num_array= new int [4]; //declaration of array and num of elements
String [] food_array = new String [4]; // declaration of array and num of elements

num_array[0]=0;
num_array[1]=0;
num_array[2]=0;
num_array[3]=0;

int size=4; //size of num_array for use in loop

int i=0; // counter for for loop

food_array[0]=gum;
food_array[1]=choc;
food_array[2]=pop;
food_array[3]=juice;

gum="gum";
choc="chocolate";
pop="popcorn";
juice="juice";

char group, selection;
System.out.println("*****************************\n***Please make your

choice***\n*****************************");
do
{
System.out.println("[1] Get Gum ");
System.out.println("[2] Get Chocolate ");
System.out.println("[3] Get Popcorn ");
System.out.println("[4] Get Juice ");
System.out.println("[5] Display Items Sold ");
System.out.println("[6] Exit");
System.out.print("Please Enter your selection : ");
selection = EasyIn.getChar();
System.out.println();
switch(selection)
{
case '1' : System.out.println("Here is your Gum!");
num_array[0] + =1;
break;
case '2' : System.out.println("Here is your Chocolate!");
num_array[1] +=1;
break;
case '3' : System.out.println("Here is your Popcorn!");
num_array[2] +=1;
break;
case '4' : System.out.println("Here is your Juice!");
num_array[3] +=1;
break;
case '5' : System.out.println("Here are your selections : ");
for(i=0;i<size;i++)
{
System.out.print("\n"+food_array[i]);
System.out.print("\t"+num_array[i]);
}
case '6' : System.exit(0);
break;
default: System.out.println("Error, options 1-6 only");
}
}while (selection != '6');
System.out.print(selection);
}
}