本栏目下题库来源于互联网,轻速云承诺对于用户导入平台的题库是严格保密的,不会在此呈现!
轻速云给您提供更好的在线考试系统服务!
二级VB上机题库31
1、【 简答题
    
Private arr(100) As Integer
Private n As Integer
Private Sub Command2_Click()
    Open App.Path & "\out5.txt" For Output As #1
    Print #1, Text1.Text
    Print #1, Text2.Text
    Print #1, Text3.Text
    Print #1, Text4.Text
    Print #1, Text5.Text
    Print #1, Text6.Text
    Close #1
    MsgBox "保存成功!"
End Sub
Private Sub Form_Load()
    Open App.Path & "\in5.txt" For Input As #1
    n = 0
    Do While Not EOF(1)
        Input #1, x
        n = n + 1
        arr(n) = x
    Loop
    Close #1
End Sub
Private Sub Command1_Click()
'========以下考生编写程序开始=======
????
'======"考生编写程序结束"=======================
End Sub [10分]
解析:
    Text1.Text = n
    count1 = 0
    count2 = 0
    count3 = 0
    count4 = 0
    count5 = 0
    count6 = 0
    For i = 1 To n
        y = Int(arr(i) / 10)
        Select Case y
            Case 1, 2, 3, 4, 5
                count1 = count1 + 1
            Case 6
                count2 = count2 + 1
            Case 7
                count3 = count3 + 1
            Case 8
                count4 = count4 + 1
            Case 9, 10
                count5 = count5 + 1
        End Select
    Next
    Text2.Text = count1
    Text3.Text = count2
    Text4.Text = count3
    Text5.Text = count4
    Text6.Text = count5
2、【 简答题
    [10分]
解析:
Private Sub C1_Click()
    C1.Width = C1.Width + 100
End Sub
3、【 简答题
    
Dim a(10) As Integer
Dim b(10) As Integer
Dim c(10) As Integer
Private Sub Command1_Click()
    Open App.Path & "\dataA.txt" For Input As #1
    Open App.Path & "\dataB.txt" For Input As #2
    For i = 0 To 9
        Input #1, a(i)
        Input #2, b(i)
    Next
    Close #1, #2
End Sub
'Private Sub find( x()  As Integer, t As ? )
 
'==================以下为考生编写的程序======================
??(1)??
'==================考生编写的程序结束========================
End Sub
Private Sub Command2_Click()
'==================以下为考生编写的程序======================
??(2)??
'==================考生编写的程序结束========================
    Open App.Path & "\out51.txt" For Output As #1
    For i = 0 To 9
        Print #1, c(i)
    Next
    Close #1
End Sub
Private Sub Command3_Click()
    Call find(a, Text1)
    Call find(c, Text2)
        Open App.Path & "\out52.txt" For Output As #1
    Print #1, Text1.Text, Text2.Text
    Close #1
End Sub [10分]
解析:
Private Sub find(x() As Integer, t As TextBox)
(1)
Max = x(0)
For i = 1 To 9
    If x(i) > Max Then
      Max = x(i)
    End If
Next i
t = Max
(2)
For i = 0 To 9
    c(i) = a(i) + b(i)
Next
4、【 简答题
    [10分]
解析:
Private Sub C1_Click()
    Form1.BackColor = &HFF&
End Sub
5、【 简答题
    [10分]
解析:
Private Sub L1_Click()
    Shape1.Shape = L1.Text
End Sub
6、【 简答题
    
Private Sub Command1_Click()
    Dim i As Integer
    For i = 0 To 1
        If Option1.Item(i) = True Then
'          Call ?
'          Label2.Caption = ?
        End If
    Next
End Sub
Private Sub calc(c As Integer)
    Dim i As Integer
    result = 0
'    x = ?
    If c = 0 Then
        For i = 1 To x
'            If ? <> 0 Then
                result = result + i
            End If
        Next
    Else
        For i = 1 To x
            If i Mod 2 = 0 Then
                result = result + i
            End If
        Next
    End If
'    Label3.Caption = ?
End Sub [10分]
解析:
          Call calc(i)
          Label2.Caption = Option1(i).Caption
    x = Val(Text1.Text)
            If i Mod 2 <> 0 Then
    Label3.Caption = result
7、【 简答题
      [10分]
解析:
  按要求解答即可
8、【 简答题
    
Private Sub Command1_Click()
    Dim i As Integer
    For i = 0 To 1
        If Option1.Item(i) = True Then
'          Call ?
'          Label2.Caption = ?
        End If
    Next
End Sub
Private Sub calc(c As Integer)
    Dim i As Integer
    result = 0
'    x = ?
    If c = 0 Then
        For i = 1 To x
'            If ? <> 0 Then
                result = result + i
            End If
        Next
    Else
        For i = 1 To x
            If i Mod 2 = 0 Then
                result = result + i
            End If
        Next
    End If
'    Label3.Caption = ?
End Sub [10分]
解析:
          Call calc(i)
          Label2.Caption = Option1(i).Caption
    x = Val(Text1.Text)
            If i Mod 2 <> 0 Then
    Label3.Caption = result
9、【 简答题
    [10分]
解析:
Private Sub List1_Click()
    Shape1.FillStyle = List1.Text
End Sub
10、【 简答题
    
Private Sub Command1_Click()
    Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
'    Timer1.Enabled = ?
End Sub
Private Sub Form_Load()
'    Timer1.Interval =?
End Sub
Private Sub Timer1_Timer()
    Picture1.Left = Picture1.Left + 200
'    If Picture1.Left > ? Then
'        Picture1.Left = ?
    End If
    HScroll1.Value = Picture1.Left
End Sub [10分]
解析:
    Timer1.Enabled = 0
    Timer1.Interval = 500
    If Picture1.Left >= Form1.Width Then
        Picture1.Left = 0
1
1页,共10个题库
1页,共10个题库
轻速云给您提供更好的在线考试系统服务!
推荐
推荐题库
众多企事业单位的信赖之选
36万+企事业单位的共同选择
查看更多合作案例
众多企事业单位的信赖之选
开始使用轻速云组织培训考试
四步组织一场考试答题,一键搭建企业培训平台
免费使用 免费使用 预约演示
咨询热线
400-886-8169
周一到周日 8:00-22:00
©2023 轻速云 苏ICP备16049646号-1 轻速云科技提供专业的在线考试系统、在线培训系统
联系我们
客服热线客服热线:400-886-8169 | 周一至周日 8:00-22:00
©2023 轻速云 苏ICP备16049646号-1
轻速云科技提供专业的在线考试系统、在线培训系统
在线咨询 400-886-8169