您使用了多少次语句:JOptionPane.showMessageDialog?如果您的答案不止一次,请返回并修改您的代码,以便您只使用一个 JOptionPane.showMessageDialog
提示:考虑使用名为 output 的 String 类型变量
代码
如果(信用> = 120)
{
JOptionPane.showMessageDialog(null,"You've graduated!");
}//end if
else if(credit >= 90)
{
JOptionPane.showMessageDialog(null,"You're a senior.");
}//end if
else if(credit >= 60)
{
JOptionPane.showMessageDialog(null,"You're a junior.");
}//end if
else if(credit >= 30)
{
JOptionPane.showMessageDialog(null,"You're a sophomore.");
}//end if
else if(credit >=0)
{
JOptionPane.showMessageDialog(null,"You're a freshment.");
}//end if
else
{
JOptionPane.showMessageDialog(null,"invalid input");
POPMUISE
aluckdog
相关分类