杭州师范学院钱江学院
计算机等级考试二级VB模拟考试参考答案
一、计算机基础题(共15分)
(一)单项选择题(10分)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 大一vb程序设计基础10 |
B | D | C | A | D | B | B | D | C | A |
(二)双选题(5分)
11 | 12 | 13 | 14 | 15 |
AC | AD | BC | BC | BD |
二、VB程序设计(共85分)
(一)判断题(10分,每题1分)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
√ | × | × | × | × | √ | √ | × | × | × |
(二)、选择题(20分,每题2分)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
C | A | D | B | B | D | D | B | C | D |
(三)程序填空题(12分,每空2分)
1 | 2 | 3 | 4 | 5 | 6 |
B | A | A | A | B | A |
(四)程序阅读题(20分,每题4分)
1、4 5 6
2、10110
3、1 9 8 7 6 5 4 3 2 10
1 7 6 5 4 3 2 8 9 10
4、1 4 6
5、wFg,C4d5
(五)程序设计题(25分,题1为5分)
1、
Public Function g(x As Single, eps As Single) As Single
Dim e&, t!, i%
If x < -1 Or x > 1 Then
g = 0
Else
e = 1
i = 1
Do
e = e * i
t = (i + x) / e
g = g + t
i = i + 1
Loop Until t < eps
End If
End Function
2、
Private Sub Form_Click()
Dim a(1 To 50) As Integer, i%, s!
For i = 1 To 50
a(i) = Val(InputBox("请输入一个数"))
Next i
s = 0
For i = 1 To 50
s = s + a(i)
Next i
s = s / 50
Open "g:\" For Output As #1
For i = 1 To 50
If a(i) > s Then Print #1, a(i)
Next I
Close #1
End Sub
3.
Dim n%
Private Sub Command1_Click()
n = Val(InputBox("输入要计时的秒数"))
Timer1.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Form_Load()
Form1.Caption = "到计时牌"
Command1.Caption = "设置"
Timer1.Interval = 1000
Timer1.Enabled = False
Label1.Caption = "计时"
End Sub
Private Sub Timer1_Timer()
n = n - 1
h = n \ 3600
m = (n Mod 3600) \ 60
s = n Mod 60
Label1 = "还剩" & h & "小时" & m & "分" & s & "秒"
If n = 0 Then
Timer1.Enabled = False
Label1 = "时间到!"
Command1.Enabled = True
End If
End Sub
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论