欢迎来到天天文库
浏览记录
ID:47841777
大小:156.50 KB
页数:37页
时间:2019-11-24
《vbnet程序设计实验指导答案代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验一dima(20)asinterger,s(10)asintergerprivatesubbuttonl_click()handlesbuttonl.clickdimi%,j%textbox1.text二〃〃fori=lto20a(i)=int(rnd*101)textbox1.text&二a(i)&space(6-len(a(i)))j=a(i)10selectcasejcaseOto5s(5)=s(5)+1case9to10s(9)=s(9)+lcase6to8s(j)二s(j)+lendse
2、lectnextiendsubprivatesubbutton2_click(・・・)handlesbutton2・clicktextbox2.text二〃0-59:〃&s(5)&vbcrlftextbox2.text二〃60-69:〃&s(6)&vbcrlfu沖【二(QdiuwiJTUOQ[二「JOJq.xauJIpuoJIPuo[二(『)duiE[asp0二(Qdui可uoipi二(Qdui可jio二1P°山『J]uo)i=rjojuO)乙二!JOJ1-xau0二(!)如可uo)[二!joj(jxo
3、)・[xoqjxoj)[ga二u%u'%『观!uiip(001)dure:mipjuoq.nqj(6)s律:ooi_O6〃二莒茁・?xoq)x茁4gqA马(8)s篦:68-08〃二莒叭pxoqHX叭FMqA马(A)s够:6Z-0Z〃二莒茁wxoqqx苗labell.text+二〃第〃&s+r(j)&〃盏灯亮〃&vbnewlineendifnextendsubtextbox1.ifnotisnumeric(textbox1.text)orval(textbox1.text)<=0thenmsgbox("请
4、输入正整数")textbox1.text二〃〃textbox1.text・focus()endifendsub实验二SY2.1PrivateSubButton2_Click(ByVaisenderAsSystem.Object,ByVaieAsSystem・EventArgs)IlandiesButton2.ClickDimf#,c#c=Val(TextBox2.Text)f=(9/5)*c+32EndSubSy2.2PublicClassFormlDimRMBAsIntegerDimChange,Do
5、iAsDoublePrivateSubButtonl_Click(ByVaisenderAsSystem.Object,ByVaieAsSystem・EventArgs)HandlesButton1.ClickTextBox1.Text=〃“TextBox2.Text=〃〃TextBox3・Text二EndSubPrivateSubButton4_Click(ByVaisenderAsSystem・Object,ByVaieAsSystem・EventArgs)HandlesButton4.ClickE
6、ndEndSubPrivateSubButton2_Click(ByValsenderAsSystem.0bject,ByVaieAsSystem.EventArgs)HandlesButton2.ClickRMB=Vai(TextBoxl.Text)Change=Vai(TextBox2.Text)Doi=RMB/ChangePrivateSubButton3_Click(ByVaisenderAsSystcm.Object,ByVaieAsSystem・EventArgs)HandlesButton
7、3.ClickDoi=Vai(TextBox3.Text)Change=Vai(TextBox2・Text)RMB=Doi*ChangeTextBoxl.Text=Format(RMB,〃#〃)EndSubEndClassSy2.3PublicClassFormlDimPI=3.1415926DimSquare#,Circle#,R#PrivateSubTextBoxl_TextChanged(ByVdlsenderAsSystcm.Object,ByVaieAsSystem・EventArgs)Han
8、dlesTextBox1.TextChangedIfIsNumeric(TextBox1.Text)二FalseOrTextBox1.Text="”ThenMsgBox(〃请输入数字〃)MsgBox(/z请输入正数!“)EndSubPrivateSubButtonlClick(ByVaisenderAsSystem.0bject,ByVaieAsSystem.EventArgs)HandlesButtonl.ClickR=Vai(TextB
此文档下载收益归作者所有