有如下程序段,该程序段执行完后,共执行循环的次数是 Private Sub Command1_Click( ) Tota1=0 Counter=1 Do Print Counter Tota1=tota1+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End lf Loop While Counter<=10 End Sub
A.5
B.10
C.12
D.20
第1题:
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1_Click()
Dim Y as String
X=5
Y=X & Space(3) & X
Print X;
Print Trim(Y);Len(Trim(Y))
End Sub
该程序的执行结果是【 】。
第2题:
在下面的程序中,要求循环体执行四次,请填空。
Private Sub Command1_Click()
x=1
Do While 【 】
x=x+2
Loop
End Sub
第3题:
有如下程序:
Private Sub Command1_Click()
j =10
For i= -1 To 1 Step 0.3
j =j + 1
Next i
Print j
End Sub
该程序共循环【 】次,程序执行完毕后j的值是【 】。
第4题:
没有如下程序
Private Sub Commandl—Click()
x=10:u=0
For i=1 TO 5
Do
x=x-2
y=y+2
Loop Until y>5 Or x<一l
Next
End Sub
运行程序,其中Do循环执行的次数是
A.15
B.10
C.7
D.3
第5题:
以下程序段中Do...Loop 循环执行的次数为【 】。程序执行完毕后,n的值为【 】。
Private Sub Command1_Click()
n =5
Do
If n Mod 2= 0 Then
n =n \2
Else
n =n* 3 + 1
End If
Loop Until n=1
End Sub
第6题:
执行下列程序,输入框中显示的默认字符串为【 】。
Private Sub Command1_Click( )
InputBox "Ok" , "输入参数", Format(" &H12" )
End Sub
第7题:
现有如下一段程序:
Option base 1
Private Sub Command1_Click()
Dim a
a=Array(3,5,7,9)
X=1
For i=4 to 1 step -1
s=s+a(i)*x
X=x*10
Next
Print s
End Sub
执行程序,单击Command1命令按钮,执行上述事件过程中,输出结果是
A)9753
B)3579
C)35
D)79
第8题:
有如下自定义过程: Sub test(x As Integer) x =X *2+1 If x<6 Then Call test(x) End If x=x* 2 + 1 Print x; End Sub调用该过程的事件过程如下:Private Sub Command1_Click() test 2End Sub则该段程序的执行结果是______ 。
A.12
B.23 47
C.23
D.5 10
第9题:
在窗体中添加一个命令按钮,并编写如下程序: Private Sub Command1_CliCk() X=1∶Y=2∶Z=3 X=Y∶Y=Z∶Z=X Print Z End Sub 程序执行后,输出的结果是______。
A.3
B.0
C.2
D.1
第10题:
有如下程序段:执行该程序段后,X的值为( )。
A.true
B.false
C.0
D.1
第11题:
有如下VB程序段: Private Sub Command1_Click() Dim a As Long a=Val(Text1.Text) Print a End Sub 其中"Private Sub Command1_Click()"的作用是()。
第12题:
定义一个数据处理方法
定义一个数据输入方法
定义一个事件过程
定义一个数据类型
第13题:
A、2 2
B、 2 2.5
C、 2.5 2
D、 2.5 2.5
第14题:
设有如下程序
Private Sub Command1 Click( )
x=10:Y=0
For i=l To 5
Do
x=x-2
y=y+2
Loop Until y>5 Or x<-l
Nex1
End Sub
运行程序,其中Do循环执行的次数是( )。
A.15
B.10
C.7
D.3
第15题:
有如下过程:
Sub SS(ByVal X,ByRef Y,Z)
X=X + 1
Y=Y + 1
Z=Z + 1
End Sub
执行该过程的事件过程如下:
Private Sub Command1_Click()
A = 1
B = 2
C = 3
Call SS(A,B,C) Print A;B;C
End Sub
则该程序的执行结果是【 】。
第16题:
有如下的程序段,该程序段执行完后,共执行的循环次数是 total=0 Counter=1 Do Print Counter total=total * Counter + 1 Print total Counter=Counter +1 If total > 10 Then Exit Do End If Loop While Counter<=10
A.4
B.10
C.15
D.20
第17题:
有如下程序段,该程序段执行完后,执行循环的次数是 total=0 Counter=1 Do Print Counter total=total + Counter Print total Counter=Counter+1 If total>10 Then Exit Do End If Loop While Counter <=10
A.5
B.10
C.15
D.20
第18题:
有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click() total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End Sub
A.5
B.10
C.12
D.20
第19题:
有如下程序段:
执行该程序后,x的值为( )。
A.true
B.false
C.0
D.1
第20题:
在窗体上画了两个按钮控件Command1和Command2,有如下程序: Private Sub Command1_Click() Print "Visual"; End Sub Private Sub Command2_Click() Print "Basic"; End Sub Private Sub Form_Load() CommandCancel=True Command1.Cancel=True End Sub 执行程序后,按键盘Cancel键,在窗体上输出的结果是
A.Basic
B.Visual
C.Cancel
D.True
第21题:
设有如下程序 Private Sub Command1 Click( ) x=10:Y=0 For i=l To 5 Do x=x-2 y=y+2 Loop Until y>j Or x<-l Nex1 End Sub 运行程序,其中Do循环执行的次数是( )。
A.15
B.10
C.7
D.3
第22题:
当数控系统在()控制方式时,执行程序的一个程序段后停止,如果再按循环启动按钮,则执行完下一个程序段后,停止。
第23题:
有如下程序段: int total = 0; for ( int i = 0; i < 4; i++ ){ if ( i == 1) continue; if ( i == 2) break;total += i;} 则执行完该程序段后total的值为()