사용자가 해시 맵을 업데이트하기로 결정할 때 코드가 올바르게 업데이트되지 않는 문제가 있습니다. 내 코드의 업데이트 섹션이새 입력으로 해시 맵을 업데이트하지 않습니다.
if(comboBoxSelection == "Update"){
String gradeValue= (String) JOptionPane.showInputDialog(null, "Choose Grades: ", "", JOptionPane.INFORMATION_MESSAGE, null, grades, "");
String creditAmount= (String) JOptionPane.showInputDialog(null, "Choose Credit: ", "", JOptionPane.INFORMATION_MESSAGE, null, credits, "");
studentObj.courseCompleted(gradeValue.charAt(0), Integer.parseInt(creditAmount));
studentDatabase.put(iD, studentObj);
}//end update combobox selection
및 변경 사항을 받아들이는 방법이다 내가 코드의 자세한 내용을 게시해야하는 경우
public void courseCompleted(char courseGrade, int creditHours){
if (courseGrade == 'A'){
totalCredit = 4;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade A
if(courseGrade == 'B'){
totalCredit = 3;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade B
if(courseGrade == 'C'){
totalCredit = 2;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade C
if(courseGrade == 'D'){
totalCredit = 1;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade D
if(courseGrade == 'F'){
totalCredit = 0;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade F
}//end courseCompleted method
나를는 기술적으로