![C#計算器 實驗報告_第1頁](http://file4.renrendoc.com/view/36501da6224ab2c405d081c142ca0f40/36501da6224ab2c405d081c142ca0f401.gif)
![C#計算器 實驗報告_第2頁](http://file4.renrendoc.com/view/36501da6224ab2c405d081c142ca0f40/36501da6224ab2c405d081c142ca0f402.gif)
![C#計算器 實驗報告_第3頁](http://file4.renrendoc.com/view/36501da6224ab2c405d081c142ca0f40/36501da6224ab2c405d081c142ca0f403.gif)
![C#計算器 實驗報告_第4頁](http://file4.renrendoc.com/view/36501da6224ab2c405d081c142ca0f40/36501da6224ab2c405d081c142ca0f404.gif)
![C#計算器 實驗報告_第5頁](http://file4.renrendoc.com/view/36501da6224ab2c405d081c142ca0f40/36501da6224ab2c405d081c142ca0f405.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
楊在工瑋為、支@腮代攵芋院FujianUniv^hyo*Ttchtio^srGuomaiInformationCollege《c#》程序報告專業(yè): 軟件工程班級: 1201班學(xué)號: 姓名: 指導(dǎo)教師: 完成日期:2014年09月20日實驗1C#面向?qū)ο蟆緦嶒災(zāi)康摹坷斫獠⒄莆誄#面向?qū)ο笾蟹椒ǖ膮?shù)類型;理解并掌握C#語言中基于委托和事件的自動響應(yīng)機(jī)制?!緦嶒灜h(huán)境】Windows2003+VisualStudio2005(或更高版本)【實驗內(nèi)容】1.計算器【實驗結(jié)果】單擊“1”“+”“6”單擊“=”
叫計算器單擊“*”和“7”單擊和“9”咱計算器再單擊“/”和”5”單擊”=叫計算器單擊“C”單擊“4”“5”“%”“+”咱計算器單擊“5”“1/x”叫計算器■丄■■丄■單擊“6”“X2”單擊“CE”明計算器Q計算器單擊“一”叫計算器單擊“V”計算器單擊“2”磅計算器單擊□e計算器【實驗核心代碼】usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication1{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();textBox1.Text="";}privateboolflag=false;privatevoidbutton1_Click(objectsender,EventArgse){if(textBoxl.Text.EndsWith("")&&textBoxl.Text.Length〉1)textBox1.Text=textBox1.Text.Substring(0,textBox1.Text.Length-3);elsetextBox1.Text=textBox1.Text.Substring(0,textBox1.Text.Length-1);}privatevoidbutton2_Click(objectsender,EventArgse){unaryoperators(2);}privatevoidbutton3_Click(objectsender,EventArgse){textBox1.Text="";flag=false;}EventArgse)privatevoidbutton4_Click(objectEventArgse)unaryoperators(4);}privatevoidbutton5_Click(objectsender,EventArgse){unaryoperators(5);}privatevoidbutton6_Click(objectsender,EventArgse){number(sender);}privatevoidbutton7_Click(objectsender,EventArgse){number(sender);}privatevoidbutton8_Click(objectsender,EventArgse)number(sender);}privatevoidbutton10_Click(objectsender,EventArgse){binocularoperators(sender);privatevoidbutton9_Click(objectsender,EventArgse){textBox1.Text=textBox1.Text.Substring(0,textBox1.Text.LastIndexOf(""));textBox1.Text+="0";}privatevoidbutton11_Click(objectsender,EventArgse){number(sender);}privatevoidbutton12_Click(objectsender,EventArgse){number(sender);}privatevoidbutton13_Click(objectsender,EventArgse){number(sender);}privatevoidbutton14_Click(objectsender,EventArgse){binocularoperators(sender);}privatevoidbutton15_Click(objectsender,EventArgse){unaryoperators(15);}privatevoidbutton16_Click(objectsender,EventArgse){number(sender);}privatevoidbutton17_Click(objectsender,EventArgse){number(sender);}privatevoidbutton18_Click(objectsender,EventArgse){number(sender);privatevoidbutton19_Click(objectsender,EventArgse){binocularoperators(sender);}privatevoidbutton20_Click(objectsender,EventArgse){Buttonbtn=(Button)sender;jscript();}privatevoidbutton21_Click(objectsender,EventArgse){number(sender);}privatevoidbutton22_Click(objectsender,EventArgse){number(sender);}privatevoidbutton23_Click(objectsender,EventArgse){binocularoperators(sender);}privatevoidnumber(objectsender){if(textBox1.Text.EndsWith("0"))textBox1.Text=""+textBox1.Text.Substring(0,textBox1.Text.Length-1);if(flag){flag=false;textBox1.Text="";Buttonbtn=(Button)sender;textBox1.Text+=btn.Text;}else{Buttonbtn=(Button)sender;textBox1.Text+=btn.Text;
}privatevoidbinocularoperators(objectsender){Buttonbtn=(Button)sender;if(!flag)jscript();textBox1.Text=textBox1.Text+""+btn.Text+"";flag=false;}privatevoidunaryoperators(inti){stringtemp=textBox1.Text.Substring(textBox1.Text.LastIndexOf(""));textBox1.Text=textBox1.Text.Substring(0,textBox1.Text.LastIndexOf(""));doubletempd=0;switch(i){case15:tempd=1/Convert.ToDouble(temp);break;case2:tempd=Convert.ToDouble(temp)/100;break;break;case4:tempd=tempd=Convert.ToDouble(temp)*Convertbreak;case5:tempd=tempd=Math.Sqrt(Convert.ToDouble(temp));break;}textBox1.Tex
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 環(huán)境友好的現(xiàn)代物流模式研究
- 電子商務(wù)平臺公開戶營銷策略深度剖析
- 電子商務(wù)平臺的產(chǎn)品推廣與品牌塑造策略
- 家具行業(yè)品牌聯(lián)合與市場共贏策略考核試卷
- 用戶體驗設(shè)計在教育領(lǐng)域的發(fā)展趨勢與挑戰(zhàn)
- 在線音樂創(chuàng)作平臺考核試卷
- 生物醫(yī)藥科技與健康產(chǎn)業(yè)融合
- 電力設(shè)施安全監(jiān)控與預(yù)防性維護(hù)策略
- 電商行業(yè)數(shù)據(jù)驅(qū)動的數(shù)字化營銷實踐
- 電力行業(yè)數(shù)據(jù)安全教育與實踐
- 信息技術(shù)課程標(biāo)準(zhǔn)2023版:義務(wù)教育小學(xué)階段
- 2024年興業(yè)銀行股份有限公司校園招聘考試試題參考答案
- 2024年常德職業(yè)技術(shù)學(xué)院單招職業(yè)適應(yīng)性測試題庫完整
- 天津市河?xùn)|區(qū)2023-2024學(xué)年九年級上學(xué)期期末數(shù)學(xué)試題
- 黑龍江省哈爾濱市2024年數(shù)學(xué)八年級下冊期末經(jīng)典試題含解析
- 克羅恩病的外科治療
- 金屬表面處理中的冷噴涂技術(shù)
- 河北省石家莊市2023-2024學(xué)年高一上學(xué)期期末教學(xué)質(zhì)量檢測化學(xué)試題(解析版)
- 建設(shè)平安校園筑牢安全防線
- 黑龍江省齊齊哈爾市2023-2024學(xué)年高一上學(xué)期1月期末英語試題(含答案解析)
- 精神科常見藥物中毒急救與護(hù)理課件
評論
0/150
提交評論