I get a java.util.InputMismatchException when I read the following information from a file:
ADDRECORD CPCS-204 289 Rayyan Alzahrani 62 58 76
Student s = null;
while (input.hasNext()) {
String command = input.next();
if (command.equals("ADDRECORD")) {
int ID = input.nextInt();
String firstName = input.next();;
String lastName = input.next();
int[] examGrades = new int[nnmCourses];
for (int i = 0; i < nnmCourses; i++) {
examGrades[i] = input.nextInt();
s = new Student(ID, firstName, lastName, examGrades);
System.out.print(nnmCourses);
}