- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
vb课后(VB after class).doc
vb课后(VB after class)
Third chapters
1, the input ladder top length, lower length and height, calculate the trapezoidal area and output, require the use of InputBox function input, using print method output. Private Sub Command1_Click ()
Dim a As Single, B As Single, H As Single
Dim s As Single
A = Val (InputBox (please input the ladder on side))
B = Val (InputBox (please input the ladder under the side))
H = Val (InputBox, enter the ladder height)
S = (a + b) * H / 2
Print trapezoid area; s
End Sub
2, input hours, minutes, seconds, converted them to seconds, and then output, Private Sub Command1_Click ()
Dim a As Single, B As Single, C As Single
A = Val (Text1)
B = Val (Text2)
C = Val (Text3)
S = a * 3600 + b * 60 + C
Label4.Caption = the number of seconds corresponding to the input time: S
End Sub
3, calculate the perimeter and area of the hypotenuse of a right triangle
Private Sub Command1_Click ()
Dim a As Integer, B As Integer
Dim C As Single, l As Single, s As Single
A = Val (InputBox (please enter the first side of a right triangle))
B = Val (InputBox (please input the right triangle second side))
Print two right angle sides of a right triangle is: a, B;
C = Sqr (a * a + b * b)
L = a + B + C
S = a * B / 2
Print hypotenuse length: C;
Print the perimeter of right triangle is: L
Print the area of right triangle is: s
End Sub
4, calculating total score and average score
Private Sub Command1_Click ()
Dim A1 As Integer, A2 As Integer, A3 As Integer, A4 As Integer
Dim sum As Integer, AVG As Single
A1 = Val (InputBox input data)
A2 = Val (InputBox input data)
A3 = Val (InputBox input data)
A4 = Val (InputBox input data)
Sum = a1 + A2 + a3 + A4
AVG = sum / 4
The overall results: MsgBox sum vbCrLf average AVG
End Sub
5, absolute value,
Private Sub Command1_Click ()
Dim a As Integer
A = Val (Text1)
If a 0 Then
Text2 = a
ElseIf a = 0 Then
Text2 = 0
Else
Text2 = -a
End If
End Sub
6. Calculate the value of the piecewise function
Private Sub Command1_Click ()
Dim x As
您可能关注的文档
- 《包法利夫人》读后感600字.docx
- 形象思维与历史教学[Word文档].doc
- vba语言基础(VBA language foundation).doc
- 笔落惊风雨诗成泣鬼神——浅谈李白诗歌的艺术成就.doc
- 青岛城阳律师:企业管理法律风险——企业证据的法律风险防范.doc
- External Sorting - UW Faculty Web Server外部排序-威斯康星大学教师的Web服务器.doc
- 孙过庭《书谱》对笔法理论的贡献[权威资料].doc
- 《红楼梦》两个英译本的可接受性调查.doc
- 委托代销业务的会计及税务处理.doc
- 有意境的心情说说句子 有意境的说说心情短语2017.doc
文档评论(0)