Visual Basic Dot Net程序设计教程第2版课后实验题.docx
- 文档编号:9597429
- 上传时间:2023-02-05
- 格式:DOCX
- 页数:10
- 大小:220.83KB
Visual Basic Dot Net程序设计教程第2版课后实验题.docx
《Visual Basic Dot Net程序设计教程第2版课后实验题.docx》由会员分享,可在线阅读,更多相关《Visual Basic Dot Net程序设计教程第2版课后实验题.docx(10页珍藏版)》请在冰豆网上搜索。
VisualBasicDotNet程序设计教程第2版课后实验题
实验二
第一题
PublicClassForm1
Dima,b,cAsInteger,avAsSingle
PrivateSubB1_Click(senderAsObject,eAsEventArgs)HandlesB1.Click
Randomize()
T1.Text=""
T2.Text=""
T3.Text=""
a=Int(Rnd()*(9-0+1)+0)
b=Int(Rnd()*(99-10+1)+10)
c=Int(Rnd()*(999-100+1)+100)
T1.Text=Val(a)
T2.Text=Val(b)
T3.Text=Val(c)
EndSub
PrivateSubB2_Click(senderAsObject,eAsEventArgs)HandlesB2.Click
av=(a+b+c)/3
L5.Text=Val(av)
EndSub
PrivateSubB3_Click(senderAsObject,eAsEventArgs)HandlesB3.Click
End
EndSub
EndClass
第四题
PublicClassForm1
PrivateSubForm1_Load(senderAsObject,eAsEventArgs)HandlesMyBase.Load
T1.Font=NewFont("BaskervilleOldFace",12)
T2.Font=NewFont("BaskervilleOldFace",12)
T1.Text="Youarethebest,butIambetter.Socomeon!
"
EndSub
PrivateSubB1_Click(senderAsObject,eAsEventArgs)HandlesB1.Click
T2.Text=Len(T1.Text)
EndSub
PrivateSubB2_Click(senderAsObject,eAsEventArgs)HandlesB2.Click
T2.Text=UCase(T1.Text)
EndSub
PrivateSubB3_Click(senderAsObject,eAsEventArgs)HandlesB3.Click
T2.Text=LCase(T1.Text)
EndSub
PrivateSubB4_Click(senderAsObject,eAsEventArgs)HandlesB4.Click
T2.Text=Trim(T1.Text)
EndSub
PrivateSubB5_Click(senderAsObject,eAsEventArgs)HandlesB5.Click
T2.Text=StrDup(5,"S")
EndSub
PrivateSubB6_Click(senderAsObject,eAsEventArgs)HandlesB6.Click
T2.Text=InStr(T1.Text,"are")
EndSub
PrivateSubB7_Click(senderAsObject,eAsEventArgs)HandlesB7.Click
T2.Text=Replace(T1.Text,"but","while")
EndSub
PrivateSubB8_Click(senderAsObject,eAsEventArgs)HandlesB8.Click
T2.Text=Mid(T1.Text,33,16)
EndSub
EndClass
第六题
PublicClassForm1
Dima,bAsInteger
PrivateSubB1_Click(senderAsObject,eAsEventArgs)HandlesB1.Click
T1.Text=""
T2.Text=""
Randomize()
a=Int(Rnd()*(999-100+1)+100)
T1.Text=Val(a)
EndSub
PrivateSubB2_Click(senderAsObject,eAsEventArgs)HandlesB2.Click
b=a\100+(a\10Mod10)*10+(aMod10)*100
T2.Text=b
EndSub
EndClass
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Visual Basic Dot Net程序设计教程第2版课后实验题 Net 程序设计 教程 课后 实验
![提示](https://static.bdocx.com/images/bang_tan.gif)