Visual Basic 综合试卷(答案)
一、单项选择题
vb语言程序设计第五版上机答案
1
2
3
4
5
6
7
8
9
10
C
B
D
B
A
A
D
A
B
C
11
12
13
14
15
16
17
18
19
20
D
C
D
C
A
C
D
A
C
D
21
22
23
24
25
26
27
28
29
30
B
B
C
A
D
A
B
C
A
C
31
32
33
34
35
36
37
38
39
40
C
D
C
D
D
B
B
A
C
A
41
42
43
44
45
46
47
48
49
50
A
C
D
D
B
C
A
B
C
B
二、填空题
1____TIMER__ interval ___ ms ___  2_____ text1=”good work!_ ”__
3_______ china __________        4_______Label1.Caption=单击此处
5_dim a(-1 to 5,2 to 6)_as string__    6_ click,load,多,cmd1,click_______
7__________1___________        8________mdichild_______________
9___工程,工程属性,form1.show_ 10__有无返回值_________________
11、s(i,j)=1    s(i,j)=0    s(i,j)
12、text files(*.txt)|*.txt    commondialog1.filename 
13、      get        14、select case x      case else   
15、  x>=0        x<amin   
16、      input #1,x     print #2,x,y
17、504          504      504   
18.   True              19.    a<>1 xor b<>1     
20.      x>=1 and x<=5     
21.  for I=1 to 10
      a(i)=100+int(400*rnd)
    next I
22.   True          23.    7     
29.          const g=9.8          30.shell(“c:\”)
三、阅读程序
1120         
20    9
3    18
6    27
9    36
9    36
3  1*1=1
2*3=6         
414                54
6、BCDEFG                  7、2 2 2
8、6 10 S=3
9.2        2        2
10.1        0        4
    2        7        8
11.NO. 3          2
    NO. 4          3
    NO. 5          5
    NO. 6          8
    NO. 7          13
四、程序设计
1.答案:
Private Sub check1_Click()
If check1.value=1 then
    Label1.fontbold=true
  Else
    Label1.fontbold=false
  End if
End Sub
Private Sub check2_Click()
  If check2.value=1 then
    Label1.fontitalic=true
  Else
    Label1.fontitalic=false
  End if
End Sub
Private Sub Command1_Click()
Unload meend
End Sub
2.答案:
Private Sub Form_click()
A=inputbox(“”)
B=inputbox(“”)
C=inputbox(“”)
If a>b then
  Max=a
Else
Max=b
End if
If max<c then max=c
End Sub
3.答案:
Private Sub Command1_Click()
For i=100 to 200
  If I mod 3=0 then print i
Next i
End Sub         
4、答案:
Private Sub Command1_Click()
Dim n As Integer
Dim i As Integer, sum As Long
n = Val(InputBox("Please input a integer", "Input N value"))
For i = 1 To n
  rnddat = (10 + Int(90 * Rnd))
  If rnddat Mod 2 = 0 Then
      sum = sum + rnddat
    End If
Next i
Label1.Caption = sum
End Sub
5、答案:
Private Sub Form_Click()
Dim a(1 To 100)
Dim b() as integer
Dim i As Integer, j As Integer, k As Integer, pos As Integer,temp as integer
For i = 1 To 100
a(i) = Val(InputBox("Please input data"))
If a(i) = Int(a(i)) Then
  j = j + 1
  ReDim Preserve b(j)
  b(j) = a(i)
End If
Next i
For k = 1 To j - 1
  pos = k

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。