GPA calculation emulator in java