You are taking input once, then looping while input is not 4. Since the input never changes, that's forever.
The break
inside the switch just jumps out of the switch
. Then you continue your loop.
Put these lines:
System.out.println("Enter 1 to set percentage of total for new grades, 2 to enter new grades, 3 to get average, and 4 to quit: ");
choice = input.nextInt();
Inside the do
loop, not outside it. Then you will ask for new input every time you loop.
You'll have to declare choice
outside the loop though, since you reference it in the while
at the bottom.
Put this line above the do
loop:
int choice;