第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在 prograde 中使用一次 JOptionPane.showMessageDialog

如何在 prograde 中使用一次 JOptionPane.showMessageDialog

慕斯709654 2021-09-29 13:41:31
您使用了多少次語句:JOptionPane.showMessageDialog?如果您的答案不止一次,請(qǐng)返回并修改您的代碼,以便您只使用一個(gè) 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");
查看完整描述

2 回答

?
POPMUISE

TA貢獻(xiàn)1765條經(jīng)驗(yàn) 獲得超5個(gè)贊

//不要忘記導(dǎo)入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");

    }

}   

}


查看完整回答
反對(duì) 回復(fù) 2021-09-29
?
aluckdog

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超7個(gè)贊

使用 if-else 語句生成要顯示的字符串,然后使用單行調(diào)用showMessageDialog()使用該字符串。


查看完整回答
反對(duì) 回復(fù) 2021-09-29
  • 2 回答
  • 0 關(guān)注
  • 210 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)