2 回答
TA贡献1765条经验 获得超5个赞
//不要忘记导入JOptionPane库
//我也不知道你是如何使用你的信用变量 public class prograde { public void showJoption(String position) { JOptionPane.showMessageDialog(null, position); }
public static void main(String[] args)
{
//this is the class object that you can use to call the showJoption() method.
prograde display = new prograde();
if(credit >= 120)
{
display.showJoption("You've graduated!");
}
else if (credit >= 90)
{
display.showJoption("You're a senior.");
}
else if (credit >= 60)
{
display.showJoption("You're a junior.");
}
else if (credit >= 30)
{
display.showJoption("You're a sophomore.");
}
else if (credit >= 0)
{
display.showJoption("You're a freshment.");
}
else {
display.showJoption("invalid input");
}
}
}
添加回答
举报