Been looking for about an hour now, do not understand where I'm going wrong.
From what I understand it's Scanner looking for an integer but finding a String instead that is causing the issue?
I'm very new to coding but from what I can make out the issue starts here:
public void inputGrades()
{
Scanner input = new Scanner(System.in);
int grade;
System.out.printf("%s\n%s\n %s\n %s\n",
"Enter the integer grades in the range 0-100.",
"Type the end-of-file indicator to terminate input:",
"On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
"On Windows type <ctrl> z then press Enter");
while( input.hasNext())
{
grade = input.nextInt();
total += grade;
++gradeCounter;
incrementLetterGradeCounter(grade);
}
}
I'm following one of Paul Deitel's books on my college course and I'm completely stumped!
Any help is much appreciated!