本栏目下题库来源于互联网,轻速云承诺对于用户导入平台的题库是严格保密的,不会在此呈现!
轻速云给您提供更好的在线考试系统服务!
二级VB上机题库11
1、【 简答题
    [10分]
解析:
  按要求解答即可
2、【 简答题
    
'提供给考生的程序
Private Function isprime(a As Integer) As Boolean
    Dim flag As Boolean
    flag = True
    b% = 2
    Do While b% <= Int(a / 2) And flag
        If Int(a / b%) = a / b% Then
            flag = False
        Else
            b% = b% + 1
        End If
    Loop
    isprime = flag
End Function [10分]
解析:
'要求考生编写的程序
Private Sub C1_Click()
    a% = 15000
    Do
        a% = a% + 1
    Loop Until isprime(a%)
    Text1.Text = a%
End Sub
Private Sub C2_Click()
    Open App.Path & "\out5.txt" For Output As #1
    Print #1, Text1.Text
    Close #1
End Sub
3、【 简答题
    [10分]
解析:
Private Sub Command1_Click()
    CD1.ShowOpen
End Sub
4、【 简答题
    
Private Function IsPrime(ByVal x As Integer) As Boolean
    Dim i As Integer
    For i = 2 To Sqr(x)
        If x Mod i = 0 Then
            IsPrime = False
            Exit Function
        End If
    Next
    IsPrime = True
End Function
Private Sub Command1_Click()
'考生编写程序开始
'======================================
  ????
'=========================================
'考生编写程序结束
    Open App.Path & "\out5.dat" For Output As #1
    Print #1, Text1.Text, Label1(0).Caption, Label1(1).Caption, Label1(2).Caption
    Close #1
End Sub [10分]
解析:
    Dim i As Integer
    Dim n As Integer
    Dim counter As Integer
    Dim arr(3) As Integer
    n = Val(Text1.Text)
    counter = 0
    For i = n - 2 To 3 Step -2
        If IsPrime(i) Then
            arr(counter) = i
            counter = counter + 1
            If counter = 3 Then
                Exit For
            End If
        End If
    Next
    For i = 0 To 2
        Label1(i).Caption = arr(i)
    Next
5、【 简答题
    [10分]
解析:
Private Sub C1_Click()
    End
End Sub
6、【 简答题
    
'提供给考生
'Private Sub C1_Click()
''    For i = ? To ?
''        If Op1(i).? = True Then
''            Print "我的出生地是" + Op1(i).?
'        End If
'    Next
'End Sub [10分]
解析:

Private Sub C1_Click()
    For i = 0 To 2
        If Op1(i).Value = True Then
            Print "我的出生地是" + Op1(i).Caption
        End If
    Next
End Sub
7、【 简答题
    
Private Sub C1_Click()
    Dim k As Integer
    For k = 0 To 2
'        If Op1(k).? = True Then
'            Call draw(?)
        End If
    Next k
End Sub
Sub draw(a As Integer)
    P1.Print "选择了" & Op1(a).Caption
End Sub [10分]
解析:
Private Sub C1_Click()
    Dim k As Integer
    For k = 0 To 2
        If Op1(k).Value = True Then
            Call draw(k)
        End If
    Next k
End Sub
Sub draw(a As Integer)
    P1.Print "选择了" & Op1(a).Caption
End Sub
8、【 简答题
    [10分]
解析:
Private Sub C1_Click()
    T1.Enabled = True
End Sub
Private Sub T1_Timer()
    Text1.Text = Text1.Text + 1
End Sub
9、【 简答题
    
'提供给考生的程序
Private Sub Form_Unload(Cancel As Integer)
    Open App.Path & "\out4.txt" For Output As #1
    Print #1, Cb1.Text, Cb2.Text, CInt(L1.Font.Size), L1.Font
    Close #1
End Sub [10分]
解析:
'要求考生编写的程序
Private Sub Cb1_Click()
    L1.Font.Size = Cb1.Text
End Sub
Private Sub Cb2_Click()
    L1.Font = Cb2.Text
End Sub
10、【 简答题
    [10分]
解析:
Private Sub Text1_Change()
    P1.Print Text1.Text                    'Text1.Text前可以加Me或Form1
'或    Text1.Parent.P1.Print Text1.Text    Text1.Text前可以加Me或Form1
'或    Me.P1.Print Text1.Text              Text1.Text前可以加Me或Form1
'或    Form1.P1.Print Text1.Text            Text1.Text前可以加Me或Form1
End Sub
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