《Visual Basic程序设计》测试题

《Visual Basic程序设计》测试题,第1张

单纤帆选BCACA

多选:1ACD

2ABCD

3ABCD

4ABCD

5ABCD

判断题搏袜都对。

如果有误,请斧毁银雹正!

Private Sub Command1_Click()

mark = Val(InputBox("输入成绩:"))

Select Case mark

Case 90 To 100

Me.Print "优秀"

Case 80 To 89

Me.Print "良好"核卜

Case 70 To 79

Me.Print "中等"

Case 60 To 69

Me.Print "及格"

Case Is <60

Me.Print "不及格"

End Select

End Sub

or

Private Sub Command1_Click()

mark = Val(InputBox("输入成绩:"闷桥))

Me.Print IIf(mark <0, "输入错误!"蚂氏猛, _

IIf(mark <60, "不及格", _

IIf(mark <70, "及格", _

IIf(mark <80, "中等", _

IIf(mark <90, "良好", _

IIf(mark <= 100, "优秀", "输入错误!"))))))

End Sub

Private Sub Command1_Click()

Dim a(10)

Dim i As Integer

Dim tmp As String

For i = 0 To 9

a(i) = InputBox("请输入第" &i + 1 &"个数戚亩链高孙字")

Next

For i = 0 To 4

tmp = a(i)

a(i) = a(9 - i)

a(9 - i) = tmp

Next

For i = 0 To 9

Print a(i)

Next

End Sub

(2)

Private Sub Command1_Click()

Dim a(8) As Integer

Dim b(8) As Integer

Dim c(8) As Integer

Dim i As Integer

a(0) = 2: a(1) = 8 '给数组赋值

b(0) = 79: b(1) = 27 '给数耐洞组赋值

For i = 0 To 7

c(i) = a(i) + b(i)

Next

For i = 0 To 7

Print a(i)

Next

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12405338.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存