位置:首页 > 题库频道 > 其它分类 > 计算机其它 > 二级二级VB07年4月计算机等级考试二级VB考前密卷(1)

下列程序段的执行结果为a=3b=1For I=1 To 3f=a + ba=bb=fPrint fNext I

发布时间:2024-07-09

A.4 3 6

B.4 5 9

C.6 3 4

D.7 2 8

试卷相关题目

  • 1下列程序段的执行结果为a=5For k=1 To 0a=a + kNext kPrint k; a

    A.-1 6

    B.-1 16

    C.1 5

    D.11 21

    开始考试点击查看答案
  • 2要将名为MyForm的窗体显示出来,正确的使用方法是

    A.MyForm.Show

    B.Show.MyForm

    C.MyForm Load

    D.MyForm Show

    开始考试点击查看答案
  • 3下列程序的功能是调用字体对话框来设置文本框字体,单击按钮弹出对话框后,按Cancel键退出对话框,则Private Sub Command1_Click()CommonDialog1.CancelError=TrueCommonDialog1.Flags=cdlCFEffects Or cdlDFBothCommonDialog1.Action=4CommonDialog1.ShowFontText1.Font.Name=CommonDialog1.FontNameText1.Font.Size=CommonDialog1.FontSizeText1.Font.Bold=CommonDialog1.FontBoldText1.Font.Italic=CommonDialog1.FontItalicText1.Font.Underline=CommonDialog1.FontUnderlineText1.FontStrikethru=CommonDialog1.FontStrikethruText1.ForeColor=CommonDialog1.ColorEnd Sub

    A.Text1的字体不发生变化

    B.Text1的字体发生变化

    C.Text1的字体和颜色发生变化

    D.程序出错!

    开始考试点击查看答案
  • 4设已经在"菜单编辑器"中设计了窗体的快捷菜单,其顶级菜单为Bs,取消其"可见"属性,运行时,在以下事件过程中,可以使快捷菜单响应鼠标右键菜单的是

    A.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _X As Single, Y As Single)If Button=2 Then PopupMenu Bs, 2End Sub

    B.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _X As Single, Y As Single)PopupMenu BsEnd Sub

    C.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _X As Single, Y As Single)PopupMenu Bs,0End Sub

    D.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _X As Single, Y As Single)If (Button=vbLeftButton) Or (Button=vbRightButton) Then PopupMenu BsEnd Sub

    开始考试点击查看答案
  • 5设在窗体上有个文本框,然后编写如下的事件过程:Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)Const Alt=4Const Key_F2=&H71altdown%=(Shift And Alt) > 0f2down%=(KeyCode=Key_F2)If altdown% And f2down% ThenText1.Text="BBBBB"End IfEnd Sub上述程序运行后,如果按 【Shift+F2】 ,则在文本框中显示得是

    A.Alt+F2

    B.BBBBB

    C.随机出几个数

    D.文本框平均内容无变化

    开始考试点击查看答案
  • 6下列程序段的执行结果为I=9x=5DoI=I + 1x=x + 2Loop Until I >=7Print "I="; IPrint "x="; x

    A.I=4x=5

    B.I=7x=15

    C.I=6x=8

    D.I=10x=7

    开始考试点击查看答案
  • 7以下程序段运行时从键盘上输入字符"-",则输出结果为op$=InputBox("op=")If op$="+" Then a=a + 2If op$="-" Then a=a - 2Print a

    A.2

    B.-2

    C.0D.+2

    开始考试点击查看答案
  • 8以下程序段的输出结果为Dim l, a(10) , p(3)k=5For i=0 To 10a(i) =iNext iFor i=0 To 2p(i) =a(i (i + 1) )Next iFor i=0 To 2k=k + p(i) 2Next iPrint k

    A.20

    B.21

    C.56

    D.32

    开始考试点击查看答案
  • 9下列程序的执行结果为Private Sub Command1_Click()Dim x As Integer, y As Integerx=12: y=20Call Value(x, y)Print x; yEnd SubPrivate Sub Value(ByVal m As Integer, ByVal n As Integer)m=m * 2: n=n - 5Print m; nEnd Sub

    A.20 1220 15

    B.12 2012 25

    C.24 1512 20

    D.24 1212 15

    开始考试点击查看答案
  • 10在窗体上画一个命令按钮,然后编写下列程序Private Sub Command3_Click()Tcl 2Tcl 3Tcl 4End SubSub Tcl(a As Integer)Static x As Integerx=x + aPrint x;End Sub程序运行后,单击命令按钮,输出结果为

    A.2 3 4

    B.2 5 9

    C.3 5 4

    D.2 4 3

    开始考试点击查看答案
返回顶部