网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Function fun(x As Integer,y As Integer) Static m As Integer Static i As Integer i=i+2 i=i+m+1 m=i+x+y fun=m End Function Private Sub Command1_Click() Dim j As Integer,m As Integer,k As Integer j=4:m=1 k=fun(j,m) Print k; k=fun (j,m) Print k End Sub
A.8 18
B.7 17
C.7 19
D.8 19
参考答案
更多 “ 在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Function fun(x As Integer,y As Integer) Static m As Integer Static i As Integer i=i+2 i=i+m+1 m=i+x+y fun=m End Function Private Sub Command1_Click() Dim j As Integer,m As Integer,k As Integer j=4:m=1 k=fun(j,m) Print k; k=fun (j,m) Print k End SubA.8 18B.7 17C.7 19D.8 19 ” 相关考题
考题
在窗体上画1一个名称为Command1的命令按钮,并编写以下程序Private Sub Command1_Click()Print fun(“ABCDEFG”)End SubFunction fun(st As String) As Stringstlen=Len(st)temp=””For kfun=tempEnd Function程序运行时,单击命令按钮,则窗体上显示的是( )。A.ABCDEFGB.AGBFCEC.GFEDCBAD.AGBFCED
考题
在窗体上画一个名称为Commandl的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(By Val m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Commandl_Click() Dim i As Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是______。A. 6B.7C.8D.9
考题
(31)设有如下通用过程:Public Function Fun(xStr As String)As StringDim tStr As String, strL As IntegertStr=""strL=Len(xStr)i=1i=i+1LoopFun=tStrEnd Function在窗体上画一个名称为 Command1 的命令按钮。然后编写如下的事件过程:Private Sub Command1_Click( )Dim S1 As StringS1="abcdef"Print UCase(Fun(S1))End Sub程序运行后,单击命令按钮,输出结果是( )。A)ABCDEFB)abcdefC)AFBECDD)DEFABC
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程:Private Function fun(ByVal m As Integer)If m Mod 2 = 0 Thenfun = 2Elsefun = 1End IfEnd FunctionPrivate Sub Command1_Click()Dim i As Integer, s As Integers = 0For i = 1 To 5s = s + fun(i)NextPrint sEnd Sub程序运行后,单击命令按钮,在窗体上显示的是( )。A.6B.7C.8D.9
考题
在窗体上画一个命令按钮,其名称为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 Function Fun(a() As Integer)Dim First As Integer, Last As Integer, i As IntegerFirst=LBound(a)Last=UBound(a)Max=a(First)For i=First To LastIf a(i) Max Then Max=a(i)NextFun=MaxEnd Function在窗体上添加一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()ReDim m(1 To 4) As Integerm(1)=20: m(2)=30: m(3)=50: m(4)=100c=Fun(m)Print cEnd Sub单击命令按钮,其输出结果为 【 】。
考题
在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()For i=1 To 4x=4For j=1 To 2x=x+6NextNextPrint xEnd Sub程序运行后,单击命令按钮,输出结果是A.12B.13C.16D.17
考题
在窗体上画一个命令按钮,然后编写如下程序 Private Sub Command4 Click() Dim a As Integer,b As Integer a=1 b=2 Print N(a,B)End Sub Function N(x As Integer,y As Integer)As Integer N=IIf(x>y,x,y) End Function 程序运行后,单击命令按钮,输出结果为A.lB.2C.5D.8
考题
假定有以下函数过程:Function Fun(S As String)As StringDim sl As StringFori=1 ToLen(S)sl=Lease(Mid(S,i,1))+s1NextiFun=s1End Function在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Commandl Click(、Dim Str1 As String.Str2 As StringStrl=InputBox(”请输入一个字符串”)Stf2=Fun(Strl)Print Str2End Sub程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体上的输出结果为A.ABCDEFGB.abcdefgC.GFEDCBAD.gfedcba
考题
在窗体上画一个名称为Command1命令按钮,然后编写如下事件过程: Private Function fun1(n As Integer)As Integer Dim k As Integer If n = 1 Then k = 1 Else k = 1 + fun1(n - 1)* 2 End If fun1 = k End Function Private Sub Command1_Click () Dim m As Integer, x As Integer x = 4 m = fun1 (x) Print m End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.4B.6C.9D.15
考题
在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl—Click() x=InputBox(“请输入一个整数”) Print x+345 End Sub 程序运行后,单击命令按钮,在输入对话框中输入123,则在窗体上输出的内容为( )A.123345B.468C.123D.345
考题
在窗体上画两个文本框和一个命令按钮,然后在命令按钮的代码窗口中编写如下事件过程:Private Sub Command1_Click()Text 1="VB programming"Text 2=Text 1Text 1="ABCD"End Sub程序运行后,单击命令按钮,文本框Text 2中显示的内容为【 】。
考题
在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() x=-5 If Sgn(x) Then y=Sgn(x^2) Else y=Sgn(x) End If Print y End Sub 程序运行后,单击命令按钮,其输出结果为 ______。A.-5B.25C.-1D.1
考题
在窗体上绘制一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click() Dim i As Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是A.6B.7C.8D.9
考题
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a$="VisualBasic" Print String(3,a$) End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是A.VVVB.VisC.sicD.11
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click () Dim a As Integer, b As Integer, c As Integer a = 1: b = 2: c = 3 Print fun2 (c, b,A)End Sub Private Function funl (x As Integer, y As Integer, z As Integer) fun1 = 2 * x + y + 3 * z End Function Private Function fun2(x As Integer, y As Integer, z As Integer) fun2 = fun1(z, x, y)+ x End Function程序运行后,单击命令按钮,则窗体上显示的内容是A.7B.14C.17D.30
考题
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Sub fun() Static a As Integer a=a+2 Print a; End Sub Private Sub Command1_Click() Dim m As Integer For m=1 To 3 Call fun Next m End SubA.2 2 2B.0 0 0C.2 4 8D.2 4 6
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Call sub1(-15.1,2.54) End Sub Public Function sub1(a As Integer,ByVa1 b As String) As Integer a=Val(B)sub1=a Print sub1 End Function 程序运行后,单击命令按钮,在窗体上输出的是A.3B.2C.-15D.提示出错
考题
在窗体上画一个按钮,然后编写如下事件代码。单击按钮,输出为 ______。 Private Function fun3(x As Integer) Static t As Integer t = t + 3 t = t + x fun3 = t End Function Private Sub Commandl Click() Dim a As Integer, b As Integer, c As Integer a = 2 : b = 1 c = fun3 (A)c = fun3 (B)Print c End SubA.6B.8C.9D.12
考题
在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下: Private Function fun(ByVal m As Integer) If m Mod 2 = 0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Cliek() Dim i As Integer, s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出( )。A.6B.7C.8D.9
考题
在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() For i=1 To 4 X=4 For j=1 To 2 X=x+6 Next Next Print x End Sub 程序运行后,单击命令按钮,输出结果是A.12B.13C.16D.17
考题
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( )。 Private Sub fun(ByVal x As Integer,ByVal y As Integer,Byval z As Integer) z=x^3*y^3 End Sub Private Sub Command1_Click() Dim m As Integer Call fun(2,3,m) Print m End SubA.216B.0C.35D.程序不能运行
考题
在窗体上画一个命令按钮,然后编写如下程序 Private Sub Command1_Click( ) Dim a As Integer,b As hiteger a=1 b=2 Print N(a,B)End Sub Function N(x As Integer,y As Integer)As Integer N=IIf(xy,x,y) End Function 程序运行后,单击命令按钮,输出结果为A.1B.2C.5D.8
考题
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() y = 8 Print fun1(1 + fun1(fun1(fun1(y)))*10) End Sub Private FLinctiOn fUnl(A)funl(A)= 1 + a End Function 程序运行后,单击命令按钮,则窗体上显示的内容是A.112B.2C.909090D.1001
考题
在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为( )。 Private Sub fun3(x As Integer) Static a As Integer Dim b As Integer a=a+3:b=b+3 a=a+x:b=b+x Printa;b End Sub Private Sub Command1_Click() Dim k As Integer,m As Integer,n As Integer k=2:m=1 Call fun3(k) Call fun3(m) End SubA.5 5 9 9B.5 5 9 4C.5 5 4 4D.5 5 4 9
考题
在窗体上添加一个名称为Command1的命令按钮,然后编写如下事件代码: Private Sub Command1_Click() A=75 If A<60 Then x=1 If A<70 Then x=2 If A<80 Then x=3 If A<90 Then x=4 MsgBox x End Sub 打开窗体运行后,单击命令按钮,则消息框的输出结果是( )。A.1B.2C.3D.4
热门标签
最新试卷