帮我看一下这个程序的错误应该怎么改.

importjavax.swing.*;publicclassChineseGrade{StringscoreString;Stringgrade;doublescore... import javax.swing.*;
public class ChineseGrade
{
String scoreString;
String grade;
double score;

public ChineseGrade()
{
scoreString=JOptionPane.showInputDialog(null,"输入成绩");
score=Double.parseDouble(scoreString);
if(score>100||score<0)
{
JOptionPane.showMessageDialog(null,"输入信息错误!","结果",JOptionPane.WARNING_MESSAGE);

}
if(score>90)
grade="A";
else if(score>80||score<90)
grade="B";
else if(score>70||score<80)
grade="C";
else if(score>60||score<70)
grade="D";
else if(score<60)
grade="E";
JOptionPane.showMessageDialog(null,grade"学生的成绩等级",JOptionPane.INFORMATION_MESSAGE);

}
public static void main(String args[])
{
ChineseGrade gradeJudge=new ChineseGrade();
System.exit(0);
}
}
展开
 我来答
jalin1220
2007-10-13
知道答主
回答量:24
采纳率:0%
帮助的人:34.1万
展开全部
import javax.swing.*;

public class ChineseGrade {
String scoreString;

String grade;

double score;

public ChineseGrade() {
scoreString = JOptionPane.showInputDialog(null, "输入成绩");
score = Double.parseDouble(scoreString);
if (score > 100 || score < 0) {
JOptionPane.showMessageDialog(null, "输入信息错误!", "结果",
JOptionPane.WARNING_MESSAGE);

} else {
if (score >= 90)
grade = "A";
else if (score >= 80 &&score < 90)
grade = "B";
else if (score >= 70 && score < 80)
grade = "C";
else if (score >= 60 && score < 70)
grade = "D";
else
grade = "E";
JOptionPane.showMessageDialog(null, "学生的成绩等级:" + grade, "结果",
JOptionPane.INFORMATION_MESSAGE);
}

}

public static void main(String args[]) {
ChineseGrade gradeJudge = new ChineseGrade();
System.exit(0);
}
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式