版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026廣西防城港市第二中學(xué)春季學(xué)期臨聘教師招聘參考考試試題及答案解析
- 2025年寧波市鎮(zhèn)海區(qū)龍賽醫(yī)療集團(tuán)招聘編外工作人員2人考試參考試題及答案解析
- 2025年安徽省水電有限責(zé)任公司第五次公開招聘5名參考考試試題及答案解析
- 深度解析(2026)《GBT 25988-2010道路車輛 牽引旅居掛車或輕型掛車的牽引連接裝置 機(jī)械強度試驗》
- 深度解析(2026)《GBT 25855-2010索具用8級連接環(huán)》(2026年)深度解析
- 2025河北聞知饒安高級中學(xué)招聘退役軍人若干備考考試試題及答案解析
- 2025青海西寧湟源縣青少年活動中心教師招聘1人備考筆試題庫及答案解析
- 2025廣西北海市中日友誼中學(xué)秋季學(xué)期教師招聘1人參考筆試題庫附答案解析
- 2025青海西寧市城北區(qū)事業(yè)單位招聘1人考試參考試題及答案解析
- 2025海南??谑兄嗅t(yī)醫(yī)院(考核)招聘事業(yè)單位人員(第七號)參考考試試題及答案解析
- 飛機(jī)機(jī)務(wù)維修工程師航空業(yè)機(jī)務(wù)維修績效表
- 茶葉知識培訓(xùn):茶葉加工
- 紅色影視鑒賞學(xué)習(xí)通超星課后章節(jié)答案期末考試題庫2023年
- 煙花爆竹企業(yè)安全生產(chǎn)責(zé)任制(二篇)
- 成人霧化吸入護(hù)理-2023中華護(hù)理學(xué)會團(tuán)體標(biāo)準(zhǔn)
- 衛(wèi)生應(yīng)急工作手冊(全)
- 長期護(hù)理保險技能比賽理論試題庫300題(含各題型)
- 含銅污泥與廢線路板協(xié)同處理及綜合利用技術(shù)
- 法律法規(guī)及其他要求獲取與識別程序
- (教師版)《項脊軒志》文言知識點檢測
- IATF-I6949SPC統(tǒng)計過程控制管理程序
評論
0/150
提交評論