网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
(27)设有如下程序
Private Sub Command 1_Click()
x=10:Y=0
For i=1 To S
Do
x=x-2
y=y+2
Loop Until y>5 Or x<-1
Next
End Sub
运行程序,其中Do循环执行的次数是
A)15
B)10
C)7
D)3
参考答案
更多 “ (27)设有如下程序Private Sub Command 1_Click()x=10:Y=0For i=1 To SDox=x-2y=y+2Loop Until y>5 Or x<-1NextEnd Sub运行程序,其中Do循环执行的次数是A)15B)10C)7D)3 ” 相关考题
考题
在窗体上画一个名称为Command1的命令按钮,并编写如下程序:Private Sub Command1_Click()Dim x As IntegerStatic y As Integerx=10y=5Call f1(x,y)Print x,yEnd SubPrivate Sub f1(ByRef x1 As Integer, y1 As Integer)x1=x1+2y1=y1+2End Sub程序运行后,单击命令按钮,在窗体上显示的内容是( )。A.10 5B.12 5C.10 7D.12 7
考题
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x=20 y=2 f=x*y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x; y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是______。A.10 5B.20 5C.20 40D.10 40
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Sum=0 For x=1 To 5 Call subl(x, s) Sum=Sum+s Next x Print Sum End Sub Private Sub subl(y, w) w=1 For i=1 To y w=w*i Next i End Sub 程序运行后。单击命令按钮,则窗体上显示的内容是______。A.5B.120C.153D.160
考题
有如下事件程序,运行该程序后输出结果是Private Sub Command33_Click()Dim X As Integer,y As Integerx=1:Y=0Do Until y=25y=y+X*XX=X+1 ‘Loop ’ 。MsgBox“x一”&X&,“y=”&yEnd SubA.x=1,y=0B.x=4,y=25C.x=5,y=30D.输出其他结果
考题
设有如下程序:Private Sub Form_Click()Dim i As Integer,x As String,Y As Stringx=”ABCDEFG”For i=4 To 1 Step-1y=Mid(x,i,i)+yNext iPrint yEnd Sub程序运行后,单击窗体,输出结果为A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG
考题
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:Private Sub Command1_Click()Dim a(10)As IntegerDim x As IntegerFor i=1 To 10a(i)=iNext ix=1MsgBoxa(f(x)+x)End SubFunction f(y As Integer)y=y+2f=yEnd Function程序运行后,单击命令按钮,消息框的输出结果为______。
考题
设有如下程序Private Sub Command1 Click( )x=10:Y=0For i=l To 5Dox=x-2y=y+2Loop Until y5 Or x-lNex1End Sub运行程序,其中Do循环执行的次数是( )。A.15B.10C.7D.3
考题
设有如下程序: Private Sub Form. Click( ) Dim i As Integer,x As String,y As String x="ABCDEFG" For i=4 To 1Step-1 y=Mid(X,i,i)+y Next i Print y End Sub 程序运行后,单击窗体,输出结果为( )。A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG
考题
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。A.6, 8B.10, 10C.10, 8D.6, 10
考题
运行下列程序: Private Sub Command1_Click() x = 0 Do While x<10 x=x * x + 1 y=y+x Loop MsgBox y End Sub 单击Command1命令按钮后,弹出的消息对话框中会显示A.5B.8C.26D.34
考题
有如下程序: Private Sub Command1_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1(a,b) End Sub Sub Sub1(x As Single,y As Single) t=X X=t\Y Y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为A.0 0B. 1 1C.2 2D.1 2
考题
没有如下程序Private Sub Commandl—Click()x=10:u=0For i=1 TO 5Dox=x-2y=y+2Loop Until y5 Or x一lNextEnd Sub运行程序,其中Do循环执行的次数是A.15B.10C.7D.3
考题
在窗体上有一个命令按钮Command1,编写事件代码如下: Private Sub Command 1_Click() Dim x As Integer,y As Integer x=12:y=32 Call Proe(X,Y) Debug.Print x;y End Sub Public Sub Proc(n As Integer,ByVal m As Integer) n=n Mod 10 m=in Mod 10 End Sub 打开窗体运行后,单击命令按钮,立即窗口上输出的结果是( )。A.2 32B.12 3C.2 2D.12 32
考题
下列程序的功能是求方程:x2+y2=1000的所有整数解。请在空白处填入适当的语句,使程序完成指定的功能。Private Sub Command 1_Click()Dim x as intege,y as integerFor x=-34 To 34For y=-34 To 34If______ThenDebug.print x,YEnd IfNext yNext xEnd Sub
考题
窗体中有命令按钮Command1,事件过程如下:Public Function f(x As Integer)As IntegerDim y As Integerx=20y=2f=x*YEnd FunctionPrivate Sub Command 1_Click()Dim y As Integerstatic x As Integerx=10y=5y=f(x)Debug.Print x;yEnd Sub运行程序,单击命令按钮,则立即窗口中显示的内容是( )。A.10 5B.10 40C.20 5D.20 40
考题
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x = 20 y = 2 f = x * y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Static x As Integer x = 10 y = 5 y = f(x) Print x;y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是A.10 5B.20 5C.20 40D.10 40
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command 1_ Click() Static y As Integer CIs For i=0 To 2 x=x +y y=y +3 Next Print x, yEnd Sub程序运行后,连续二次单击Command1按钮后,窗体上显示的是______。A.9 9B.36 18C.30 12D.63 27
考题
在窗体上画一个名称为Command1的命令按钮,并编写如下过程: Private Sub Command1_Click() Dim x AS Integer Static y As Integer x=10 y=5 Call f1(x, y) Print x,y End Sub Private Sub f1(ByRef x1 As Integer, y1 As Integer) x1=x1+2 y1=y1+2 End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是______。A.10 5B.12 5C.10 7D.12 7
考题
下面程序的运行结果是 Private Sub Command1_Click() x=1:y=1 For i=1 To 3 x=x+y:y=y+x Next i:print x,y End SubA.6 6B.5 8C.13 21D.34 35
考题
在窗体上画一个名称为Command1的命令按钮,并编写如下程序: Private Sub Command1_Click( ) Dim x As Integer Static y As Integer x=10 y=5 Call f1(x,y) Print x,y End Sub Private Sub f1(ByRef x1 As Integer,y1 As Integer) x1=x1+2 y1=y1+2 End Sub程序运行后,单击命令按钮,在窗体上显示的内容是A.10 5B.12 5C.10 7D.12 7
考题
设有如下程序 Private Sub Command1 Click( ) x=10:Y=0 For i=l To 5 Do x=x-2 y=y+2 Loop Until yj Or x-l Nex1 End Sub 运行程序,其中Do循环执行的次数是( )。A.15B.10C.7D.3
考题
编写如下程序: Private Sub Command1_Click() x="abcd" y="1234" For i=1 To 4 z=z+Mid(x,i,1)+Left(y,1) Next i Print z End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.abcd1234B.a1b2c3d4C.a1b1c1d1D.1234abcd
考题
在窗体上画一个名称为Command1的命令按钮,并编写如下程序: Private Sub Command1_Click( ) Dim x As integer Static y As integer x=10 y=5 Call f1(x,y) Print x,y End Sub Private Sub f1(ByRef xl As Integer,y1 As Integer) x1=x1+2 y1=y1+2 End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是A.10 5B.12 5C.10 7D.12 7
考题
程序代码如下,当单击窗体上的Command1控件时,窗体上输出的结果是( )。 Private Sub Command1_Click() Dim Y As Integer,I As Integer Dim A(7)As Integer Y=18:I=0 Do A(I)=Y Mod 2 I=I+1 Y=Y\2 Loop Until Y<1 For j=I-1 To 0 Step-1 Print A(j); Next j End SubA.1 0 0 0B.1 0 0 1 0C.0 0 1 1 0D.1 0 1 0 0
考题
设有如下程序: Private Sub Form. Click( ) Dim i As Integer,x As String,y As String x=ABCDEFGFor i=4 To 1Step-1y=Mid(X,i,i)+yNext iPrint yEnd Sub程序运行后,单击窗体,输出结果为( )。A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Staticy As Integer Cls For i=0 To 2 x=x+y y=y+3 Next Printx,y End Sub 程序运行后,连续二次单击Command1按钮后,窗体上显示的是 ______。A.9 9B.36 18C.30 12D.63 27
考题
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim x As Integer,y As Integer x = 41: y = 54 Call sub1(x,y) x = x + 1 Print x; y End Sub Private Sub sub1(n As Integer, ByVal m As Integer) n=n Mod 10 m=m\10 End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.41 54B.2 54C.1 3D.42 3
热门标签
最新试卷