浙江技术选考复习VB自定义函数调用专题.docxVIP

  • 12
  • 0
  • 约1.27千字
  • 约 1页
  • 2020-09-12 发布于天津
  • 举报

浙江技术选考复习VB自定义函数调用专题.docx

VB白定义函数专题练习 行政班: 教学班: 姓名: 学号: 阅读下面程序,填入划线处代码通过 调用函数,使程序功能完善 Function fx(x As Integer) As Boolean If x Mod 5 = 0 Then fx = True Else fx = False End If End Function Private Sub Command1_Click() Dim a As Integer a = Val(Text1.Text) If Then Label1.Caption = 是 5 的倍数 Else Label1.Caption = 不是 5 的倍数 End If End Sub 阅读下面程序,程序的功能是计算 1+1+2+1+2+3+1+2+3+4+1+2+3+4+5 的值,并 在Text1上显示,填入划线处代码 Function fact(n As Integer) As Integer Dim i As Integer fact = 0 For i = 1 To n fact = fact + i Next i End Function Private Sub Command1_Click() Dim i As Integer, s As Integer s = 0 Fori = 1 To 5 Next i Text1.Text = End S

文档评论(0)

1亿VIP精品文档

相关文档