本栏目下题库来源于互联网,轻速云承诺对于用户导入平台的题库是严格保密的,不会在此呈现!
轻速云给您提供更好的在线考试系统服务!
二级VB上机题库26
1、【 简答题
    [10分]
解析:
  按要求解答即可
2、【 简答题
    
Option Base 1
Dim s As String
Private Sub Command1_Click()
    Open App.Path & "\in5.dat" For Input As #1
    s = Input(LOF(1), #1)
    Close #1
End Sub
Private Sub Command2_Click()
'需考生编写
?????
    If Len(t) > Max_len Then
        Max_len = Len(t)
        Max_word = t
    End If
    Text1.Text = Max_len
    Text2.Text = Max_word
End Sub
Private Sub Form_Unload(Cancel As Integer)
    Open App.Path & "\out5.dat" For Output As #1
    Print #1, Text1.Text, Text2.Text
    Close #1
End Sub [10分]
解析:
    n = Len(s): t = ""
    Dim Max_len As Integer
    For i = 1 To n
        c = Mid(s, i, 1)
        If c <> " " Then
            t = t + c
        Else
            If Len(t) > Max_len Then
                Max_len = Len(t)
                Max_word = t
            End If
            t = ""
        End If
    Next i
3、【 简答题
    
Option Base 1
Dim s As String
Private Sub Command1_Click()
    Open App.Path & "\in5.dat" For Input As #1
    s = Input(LOF(1), #1)
    Close #1
End Sub
Private Sub Command2_Click()
'需考生编写
?????
End Sub
Private Sub Form_Unload(Cancel As Integer)
    Open App.Path & "\out5.dat" For Output As #1
    Print #1, Text1.Text, Text2.Text
    Close #1
End Sub [10分]
解析:
    n = Len(s): t = ""
    Dim word_max As Integer, word_num As Integer, word_len As Integer
    For i = 1 To n
    c = Mid(s, i, 1)
    If c <> " " Then
        t = t + c
    Else
        word_len = word_len + Len(t)
        word_num = word_num + 1
        If Len(t) > word_max Then
            word_max = Len(t)
        End If
        t = ""
    End If
    Next i
    Text1.Text = CInt((word_len + Len(t)) / (word_num + 1))
    If Len(t) > word_max Then
        word_max = Len(t)
    End If
    Text2.Text = word_max
4、【 简答题
    
Private Sub C1_Click()
    Dim A$, B$, k%, n%
    A$ = ""
    ? = Asc("a") - Asc("A")
    For k% = 1 To Len(Text1.Text)
        B$ = Mid(?)
        If B$ >= "a" And B$ <= "z" Then
            B$ = String(1, Asc(B$) - n%)
        Else
            If B$ >= "A" And B$ <= "Z" Then
                B$ = String(1, Asc(B$) + 32)
            End If
        End If
        A$ = ?
    Next k%
    Text1.Text = A
End Sub [10分]
解析:
    n% = Asc("a") - Asc("A")
        B$ = Mid(Text1.Text, k%, 1)
        A$ = A$ + B$
5、【 简答题
    

    
Private Sub Cmd1_Click()
  '? = Str(Time())
  Text1(1).Text = "": Text1(2).Text = ""
  Cmd1.Enabled = False
  Cmd2.Enabled = True
End Sub
Private Sub Cmd2_Click()
  Text1(1).Text = Str(Time())
  t_start = Hour(Text1(0).Text) * 3600 + Minute(Text1(0).Text) * 60 + Second(Text1(0).Text)
  t_end = Hour(Text1(1).Text) * 3600 + Minute(Text1(1).Text) * 60 + Second(Text1(1).Text)
  t = t_end - t_start
  h = t \ 3600
  m = t \ 60
  If m < t / 60 Then m = m + 1
  s = 0.5
  If m - 3 > 0 Then
    's = ? + (m - 3) * 0.15
  End If
  Text1(2).Text = Str(s) + "元"
      '?= True
  '?= False
End Sub [10分]
解析:
  Text1(0).Text = Str(Time())
    s = s + (m - 3) * 0.15
  Cmd1.Enabled = True
  Cmd2.Enabled = False
6、【 简答题
    [10分]
解析:
  按要求解答即可
7、【 简答题
    [10分]
解析:
Private Sub Form_Unload(Cancel As Integer)
    Open App.Path & "\out4.txt" For Output As #1
    Print #1, Op1.Value, Op2.Value, Text1.Text, Text2.Text, Text3.Text
    Close #1
End Sub
Private Sub Text3_Click()
    If Op1 Then
        Text3.Text = Text1.Text
        Text1.Text = Text2.Text
        Text2.Text = Text3.Text
        Text3.Text = "交换成功"
    ElseIf Op2 Then
        Text3.Text = Text1.Text & Text2.Text
    End If
End Sub
8、【 简答题
    [10分]
解析:
Private Sub Command1_Click()
Shape1.FillStyle = 3
End Sub
Private Sub Command2_Click()
Form1.Shape1.FillStyle = 2
End Sub
9、【 简答题
    
Dim a(100) As Integer, num As Integer
Private Sub Command1_Click()
    Dim k As Integer
    Open App.Path & "\in4.dat" For Input As #1
    For k = 1 To 60
        Input #1, a(k)
        Text1 = Text1 + Str(a(k)) + Space(2)
    Next k
    Close #1
End Sub
Private Sub Command2_Click()
  num = InputBox("请输入一个数")
End Sub
Private Sub Command3_Click()
    For i = 1 To 60
      'If num < a(i) Then ?
    Next i
    'For j = 60 To i ?
      'a(j + 1) =?
    Next j
    '?= num
    Text1 = ""
    '以下程序段将插入后的数组A重新显示在Text1中
    'For k = 1 To ?
        Text1 = Text1 + Str(a(k)) + Space(2)
    Next k
End Sub [10分]
解析:
      If num < a(i) Then Exit For
    For j = 60 To i Step -1
      a(j + 1) = a(j)
    a(i) = num
    For k = 1 To 61
10、【 简答题
    [10分]
解析:
Private Sub Command1_Click()
  Label1.FontName = "宋体"
End Sub
Private Sub Command2_Click()
  Label1.FontName = "黑体"
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