# 华北科技学院计算机系综合性实验,华北科技学院计算机系综合性实验.doc

1先进入欢迎界面，在屏幕上显示"欢迎您使用"，并弹出密码框，等待输入密码。(5％)(密码为123456)

Private Sub Command1_Click()

If Text1.Text <> "123456" Then

Text1.SetFocus

Text1.Text = ""

Else

Form2.Show

End If

End Sub

Private Sub Text1_Change()

End Sub

2密码正确后进入系统主界面，主界面包括“数组应用”、“过程应用”、“控件应用”和“退出”等菜单，并提供相关工具栏或命令按钮。

(1)“数组应用”菜单中包括“数组操作”子菜单，单击此菜单，弹出“数组操作”对话框，如图1所示。(35％，每个按钮功能为5％)。

Dim a(1 To 10) As Long

Private Sub Command1_Click()

For i = 1 To 10

For j = i + 1 To 10

If a(j) < a(i) Then

t = a(j): a(j) = a(i): a(i) = t

End If

Next j

Next i

Text1.Text = ""

For i = 1 To 10

Text1.Text = Text1.Text + Str(a(i))

Next i

End Sub

Private Sub Command2_Click()

For i = 1 To 10

For j = i + 1 To 10

If a(j) > a(i) Then

t = a(i): a(i) = a(j): a(j) = t

End If

Next j

Next i

Text2.Text = ""

For i = 1 To 10

Text2.Text = Text2.Text + Str(a(i))

Next i

End Sub

Private Sub Command3_Click()

Max = a(1)

For i = 2 To 10

If Max < a(i) Then Max = a(i)

Next i

Text3.Text = Max

End Sub

Private Sub Command4_Click()

Min = a(1)

For i = 2 To 10

If a(i) < Min Then Min = a(i)

Next i

Text4.Text = Min

End Sub

Private Sub Command5_Click()

Dim i As Long

For i = 1 To 10

a(i) = Rnd * 100

a(i) = InputBox("请输入第" & i & "个数")

If Not IsNumeric(a(i)) Then

MsgBox "输入必须为数字", , "警告"

End If

Next i

Command2.Enabled = True

Command3.Enabled = True

Command4.Enabled = True

Command5.Enabled = False

Command6.Enabled = True

Command1.Enabled = True

For i

• 0
点赞
• 0
收藏
觉得还不错? 一键收藏
• 0
评论
01-12
09-10
09-10

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、付费专栏及课程。