/** I have to use the scanner class (no alternatives), to record a dynamic amount of grades. I use the hasNext() method to get the next value on the same line. For some reason when I am done entering numbers and I press enter the curser waites on the next line and does not exit the program. I want to be able to exit the program once I have entered multable grades and then pressed enter. */
public void enterGrades()
{
Scanner scan = new Scanner(System.in);
ArrayList<String> al = new ArrayList<String>();
System.out.print("Enter grades: ");
while(scan.hasNext())
{
al.add(scan.next() );
System.out.println(al);
}
}