Im new to programming and i have a question i cant get my head round.. can anyone help?
here is the code ive done so far
public class vend
{
public static void main(String[] args)
{
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.print("Please Enter your selection : ");
selection = EasyIn.getChar();
System.out.println();
switch(selection)
{
case '1' : System.out.println("Here is your Gum!");break;
case '2' : System.out.println("Here is your Chocolate!");break;
case '3' : System.out.println("Here is your Popcorn!");break;
case '4' : System.out.println("Here is your Juice!");break;
case '5' : System.out.println("Here is your selection : ");break;
default: System.out.println("Error, options 1-5 only");
}
}while (selection != '5');
System.out.print(selection);
}
}

However i need to make it so when the user enters 5 the program gives them a list of the items they have selected so far and then exit. Please could someone help becouse i have no idea how to do this!!