VB程序設计教程第三版泷沛曾等著实验B答案.docVIP

  • 0
  • 0
  • 约1.58千字
  • 约 5页
  • 2016-10-16 发布于重庆
  • 举报

VB程序設计教程第三版泷沛曾等著实验B答案.doc

VB程序設计教程第三版泷沛曾等著实验B答案

VB程序设计教程 第三版 泷沛曾等著 实验B 答案 第一题 Private Sub Command1_Click() Dim f!, c! f = Val(Text1) c = 5 / 9 * (f - 32) Text2 = Format(c, 0.00) End Sub Private Sub Command2_Click() Dim c!, f! c = Val(Text2) f = 9 / 5 * c + 32 Text1 = Format(f, 0.00) End Sub ? 第二题 Private Sub Command1_Click() Dim r!, s! r = Val(Text1) s = 3.14 * r ^ 2 Label2 = Format(s, 0.00) End Sub Private Sub Command2_Click() Dim r!, d! r = Val(Text1) d = 2 * r * 3.14 Label3 = Format(d, 0.00) End Sub Private Sub Text1_lostfocus() If Not IsNumeric(Text1) Then Text1 = MsgBox(输入有非数字字符,请重新输入) Text1.SetFocus End If End Sub 第四题?? Private Sub Command1_Click() Text1.Text = UCase(Text1) Label1 = Len(Text1) End Sub ? Private Sub Text1_lostfocus() If IsNumeric(Text1) Then Text1 = MsgBox(输入有非字母字符,请重新输入) Text1.SetFocus End If End Sub 第五题??? ? Private Sub Form_Click() Randomize Dim a As Integer, b As Integer, c As Integer, d As Integer d = Int(Rnd * 900 + 100) Print d a = d \ 100 b = (d / 10) Mod 10 c = d Mod 10 Print c b a End Sub ? 第6题 Private Sub Form_click() label1=left(text1,3) label2=mid(text1,4,4) label3=right(text1,3) end sub 第8 题 ? Private Sub Form_click() Dim a!, b!, c!, d!, e! a = Val(InputBox(输入实数)) b = a ^ 2 c = Sqr(a) d = a ^ 3 e = a ^ (1 / 3) Print 平方; Format(b, 0.000); 平方根; Format(c, 0.000); 立方; Format(d, 0.000); 立方根; Format(e, 0.000) End Sub

文档评论(0)

1亿VIP精品文档

相关文档