freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

使用面向?qū)ο蟮膉ava編程技術(shù)設(shè)計(jì)實(shí)現(xiàn)計(jì)算器含源代碼(編輯修改稿)

2024-12-14 06:50 本頁面
 

【文章內(nèi)容簡介】 n[i] = new JButton(optName[i])。 optButton[i].setForeground()。 optButton[i].setBackground()。 optButton[i].addActionListener(eventListener)。 (optButton[i])。 } for (int i = 0。 i 。 i++) { numButton[i] = new JButton(numName[i])。 numButton[i].setForeground()。 numButton[i].addActionListener(eventListener)。 (numButton[i])。 } (new WindowAdapter() {// 關(guān)閉主面板 @Override public void windowClosing(WindowEvent arg0) { (0)。 } })。 (400, 300, 250, 200)。 (false)。// 計(jì)算機(jī)不能改變大小 (true)。 ()。 } 更多課程設(shè)計(jì)、畢業(yè)設(shè)計(jì)、論文請?jiān)L問: 10 class EventListener implements ActionListener { double result。// 兩個運(yùn)算數(shù)運(yùn)算完后得到的結(jié)果 double firstNum。// 第一個運(yùn)算數(shù) double secondNum。// 第二個運(yùn)算數(shù) String showResult = 。// 顯示器上顯示的 結(jié)果 String fuhao。// 運(yùn)算符, +,,*,/ String caozuo。 String temp。// 每按一個按鈕的值 public void actionPerformed(ActionEvent ae) { for (int i = 0。 i 。 i++) { if (() == numButton[i]) { String temp = numButton[i].getText()。 if ((+) || ()|| (*) || (/)) { if(())//如果顯示器為空,則顯示輸入錯誤 (輸入錯誤,請重新輸入 )。 else{ firstNum = (showResult)。 fuhao = temp。 (fuhao)。 showResult = 。 } // (firstNum*2)。//測試 } 更多課程設(shè)計(jì)、畢業(yè)設(shè)計(jì)、論文請?jiān)L問: 11 else if ((=)) { if(())//如果顯示器為空,則顯示輸入錯 誤 (輸入錯誤,請重新輸入 )。 else{ secondNum = (showResult)。 } if ((+)) { result = firstNum + secondNum。 ( + result)。 } else if (()) { result = firstNum secondNum。 ( + result)。 } else if ((*)) { result = firstNum * secondNum。 ( + result)。 } else if ((/)) { if(secondNum==0) (分母為 0,計(jì)算錯誤 )。 else{ result = firstNum / secondNum。 ( + result)。 } 更多課程設(shè)計(jì)、畢業(yè)設(shè)計(jì)、論文請?jiān)L問: 12 } // (secondNum*3)。//測試 } else { showResult += temp。 (showResult)。 } } } if (() == optButton[0]) { if (() 0) { showResult = (0, () 1)。 (showResult)。 } else { showResult = 。 (showResult)。 } // caozuo = optButton[0].getLabel()。 } else if (() == optButton[1]) { // 清除當(dāng)前的輸入數(shù),如之前已存在了第一個運(yùn)算數(shù),不影響第一個運(yùn)算數(shù) showResult = 。 更多課程設(shè)計(jì)、畢業(yè)設(shè)計(jì)、論文請?jiān)L問: 13 (showResult)。 temp = 。 // caozuo = optButton[1].getLabel()。 } else if (() == optButton[2]) {// 清空所有的數(shù)字及運(yùn)算符,回到初始狀態(tài) // caozuo = optButton[2].getLabel()。 showResult = 。 (showResult)。 temp = 。 fuhao = 。 } } } public static void main(String[] args) { new Calculator(計(jì)算器 )。// 創(chuàng)建實(shí)例 } } 更多課程設(shè)計(jì)、畢業(yè)設(shè)計(jì)、論文請?jiān)L問:
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1