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

正文內(nèi)容

簡易計算器課程設計-wenkub

2023-06-18 01:56:57 本頁面
 

【正文】 (this)。 (this)。 (this)。 (this)。 (this)。 (c)。 (eight)。//C ()。 ce=new JButton(CE)。 ()。 (eight)。 (this)。 num9=new JButton(9)。 sin=new JButton(sin)。 num6=new JButton(6)。 num2=new JButton(2)。 kai = new JButton(sqrt)。 quyu = new JButton(%)。 jian = new JButton()。 (false)。 (false)。 (false)。 (false)。 (false)。 (new GridLayout(1,1))。 cp=getContentPane()。 ()。 public Calculator(){ super(計算器 )。 int all=0。 Container cp。 JMenuItem fileMenu,exitItemOfFile,s,t, about, me。 import 。 * * 繼承的父類 : JFrame 類 * * 實現(xiàn)的接口 :ActionListener 類 * ********************************************************** * 類名 : WindowDestroyer * * 作用 : 退出窗口動作。 事件監(jiān)聽器中的事件處理方法 void actionPerformed(ActionEvent event)完成主要的按鈕事件的處理。 十進制與二進制、八進制、十六進制之間 的轉(zhuǎn)換。 三 、需求分析 日常生活中經(jīng)常需要用到計算器,比如科學計算、數(shù)值計算、會計業(yè)務等 ,但簡單的計算器已不能滿足日常需要,因此有必要開發(fā)一些進制轉(zhuǎn)換、開方等多種運算的計算器。 在我的計算器上實現(xiàn)了以上功能。 1 目錄 一、運行環(huán)境 5 二、問題描述及要求 21 八、源代碼 在菜單欄有 查看、編輯、幫助菜單,在“查看”菜單中有“標準型”菜單項,實現(xiàn)加減乘除等基本功能,“科學型”菜單項,實現(xiàn)進制間的轉(zhuǎn)換。 創(chuàng)建一個簡單計算器,具有簡單的人機交互界面, 便于數(shù)據(jù)計算。 菜單中包含的一些功能,如幫助文檔。事件分為以下幾種情況:數(shù)字按鈕事件(0~9)、運算符按鈕事件(+、-、/、 % ) 、正負號按鈕事件(+/-)、小數(shù)點按鈕事件(.)、等號按鈕事件(=)、求倒按鈕事件(1/x)、三角函數(shù)按鈕事件( cos, sin, tan)、開方按鈕開始 按鍵判斷 進制轉(zhuǎn)換 數(shù)字按鍵 運用相應處理 按鍵判斷 運算符按鍵 進制轉(zhuǎn)換 顯示結(jié)果 是否繼續(xù)操作 結(jié)束 4 事件( sqrt)、對數(shù)按鈕事件( lgX, lnX)、進制轉(zhuǎn)換按鈕事件。 * * 繼承的父類 : WindowAdapter 類 * * 實現(xiàn)的接口 :無 * ********************************************************** * 類名 : objConversion * * 作 用 : 各個進制之間的轉(zhuǎn)換。 import .*。 JRadioButton sixteen,ten,eight,two。//容器,便于集體操作 JTextField text。 double qian。 setSize(400,400)。//從左到右 JPanel cp1=new JPanel()。 (cp1,North)。 (new GridLayout(2,4))。 ten=new JRadioButton(進制 ,true)。 two=new JRadioButton(二進制 )。 b = new JButton(B)。 dd = new JButton(D)。 ff = new JButton(F)。 cheng = new JButton()。 deng = new JButton(=)。 dao = new JButton(1/x)。 num3=new JButton(3)。 num7=new JButton(7)。 7 tan=new JButton(tan)。 (this)。 ButtonGroup btg=new ButtonGroup()。 (two)。 Back=new JButton(Back)。//CE ()。 (this)。 (two)。 (num7)。 (num9)。 (kai)。 (num5)。 (cheng)。 (num1)。 (num3)。 (dao)。 (fu)。 9 (jia)。 (cos)。 (tan)。 (lgX)。 ()。 ()。 ()。 ()。 ()。 ()。 JMenu editMenu = new JMenu(編輯 )。 (editMenu)。 (this)。 t = new JMenuItem(●標準型 )。 (this)。 (about)。 addWindowListener(new WindowDestroyer())。 (false)。 (2. 單擊“ +”執(zhí)行加、“ ”執(zhí)行減、“ *”執(zhí)行乘或“ /”執(zhí)行除+\n)。 +\n)。 fuhao = +。 clear = false。 } if(temp==chu){ qian = (())。 fuhao=%。 if (fuhao == +) (qian + ss + )。) (qian / ss + )。 } if(temp==sin){ ((((())*)))。 } 4、開方、求倒運算 if (temp == kai){ String s = ()。 else (( ((()))))。 amp。 int i, j, k。 i++) if ((i) == 39。 j ()。 break。 k++) stemp += (k)。 } 5、正負號運算 if (temp == fu){ boolean isNumber = true。 i++) if(!((i)=39。(i)=39。||(i)==39。 } 16 if (isNumber == true){ if ((0) == 39。 i ()。39。 for (int i = ()。 } public String decHex (int decNum){//10 to 16 String strHexNum = 。 } 17 else{ currentNum = decNum。 case 14: strHexNum += E。 case 12: strHexNum += C。 case 10: strHexNum += A。 } } return invert(strHexNum,2)。 }else{ strOctNum += (decNum)。 while (decNum != 0) { if (decNum 1){ strBinNum += (decNum % 2)。 } } return invert (strBinNum, 8)。padding0。i) answer+=(i1)。本次的 Java課程設計讓我對 Java的理論知識又有了更深一步的了解,溫故而知新,開始設計時完全沒頭緒,感覺很混亂,對書本知識不夠 扎實的我深感“書到用時方恨少”,只好又一遍瀏覽全書,讓我對其有了大概的復習,對知識系統(tǒng)全面進行了了解,讓我里出了我設計的框架,遇到困難時先是苦思冥想在向同學請教。因此在以后的學習中我會通過實踐來檢驗自己的不足和加深、鞏固自身。由于專業(yè)知識有限,以及動手能力的欠缺,所以開發(fā)的系統(tǒng)不是很完善,有一些功能未實現(xiàn),但是簡易計算器的基本功能均已實現(xiàn)。 import 。//各個進制之間的轉(zhuǎn)化 JMenuItem fileMenu,exitItemOfFile,s,t, about, me。 Container cp。 int all=0。 public Calculator(){ super(計算器 )。 ()。 20 cp=getContentPane()。 (new GridLayout(1,1))。 (false)。 (false)。 (false)。 (false)。 (false)。 jian = new JButton()。 quyu = new JButton(%)。 kai = new JButton(sqrt)。 num2=new JButton(2)。 num6=new JButton(6)。 sin=new JButton(sin)。 num9=new JButton(9)。 (this)。 (eight)。 ()。 ce=new JButton(CE)。//C ()。 (eight)。 (c)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 (this)。 ()。 ()。 ()。 ()。 ()。 ()。 setJMenuBar(mainMenu)。 (viewMenu)。 exitItemOfFile = new JM
點擊復制文檔內(nèi)容
畢業(yè)設計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1