私のプログラムでは、ユーザーは数字を入力し、以下のメソッドは数字を計算し、入力した数字に基づいてユーザーにメッセージを表示しますが、ifステートメントを使用して数字に与えるメッセージを計算しますが、ユーザーが数字を入力するとすべてのメッセージが表示されます。数字は 10 のセットになっています。つまり、ユーザーが 40 から 49 までの数字を入力すると、E グレードのメッセージが出力されます。比較される指定された番号のメッセージ?
public void checkInputScore() {
if (convertedInputScore == -1) {
System.exit(0);
}
if (convertedInputScore < 39) {
JOptionPane.showMessageDialog(Program1.this, "The student received a fail grade", "Student mark checker", JOptionPane.INFORMATION_MESSAGE);
}
if (convertedInputScore <= 49) {
JOptionPane.showMessageDialog(Program1.this, "The student received an E grade", "Student mark checker", JOptionPane.INFORMATION_MESSAGE);
}
if (convertedInputScore <= 59) {
JOptionPane.showMessageDialog(Program1.this, "The student received an D grade", "Student mark checker", JOptionPane.INFORMATION_MESSAGE);
}`