public class StudentGrades {
String studentID;
Integer numericGrade;
Scanner input = new Scanner(System.in);
public void loadStudentGrades(){
do{
System.out.println("Please enter a Student ID, or enter 'end' to exit: ");
studentID = input.next();
System.out.println("Please enter numeric grade for the ID above: ");
numericGrade = input.nextInt();
map.put(studentID, numericGrade);
}
while (studentID !String.equals("end")); //this is throwing an error. How is it possible to get this to work?
}
}
I'm working on this class and am finding it difficult to get the while part of my do-while loop to work the way I was expecting it to. I want to say while studentID is not equal to "end" to go through the loop.