网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
在窗体上画一个命令按钮(名称为Command1),并编写下列代码:
Function Fun1(ByVa1 a As Integer,b As Integer)As Integer
Dim t As Integer
t=a-b
b=t+a
Fun1=t+b
End Function
Private Sub Command1Click( )
Dim X As Integer
x=10
Print Fun1(Vun1(X,(Fun1(x,x-1))),x-1)
End Sub
程序运行后,单击命令按钮,输出结果是( )。
A.10
B.0
C.11
D.21
参考答案
更多 “ 在窗体上画一个命令按钮(名称为Command1),并编写下列代码:Function Fun1(ByVa1 a As Integer,b As Integer)As IntegerDim t As Integert=a-bb=t+aFun1=t+bEnd FunctionPrivate Sub Command1Click( )Dim X As Integerx=10Print Fun1(Vun1(X,(Fun1(x,x-1))),x-1)End Sub程序运行后,单击命令按钮,输出结果是( )。A.10B.0C.11D.21 ” 相关考题
考题
在窗体上画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
考题
在窗体上添加一个名称为Command1的命令按钮,然后编写如下程序:Private Sub f(ByVa1 x As Integer)x=x+4End SubPrivate Sub Command1_Click()i=3Call f(1)If i>4 Then i=i*2MsgBox iEnd Sub打开窗体运行后,单击命令按钮,则消息框的输出结果为______。
考题
设有如下通用过程: 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
考题
在窗体上画1个命令按钮,其名称为Command1,然后编写如下程序: Private Sub Command1 Click() Dim a(10) As Integer Dim x As Integer For i=1 To 10 a(i)=8+i Next x=2 Print a(f(x)+x) End Sub Function f(x As Integer) x=x+3 f=x End Function 程序运行后,单击命令按钮,输出结果为______。A.12B.15C.17D.18
考题
在窗体上画1个命令按钮,名称为Command1,然后编写如下程序: Dim Flag As Boolean Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(“请输入:”) If Flag Then Print f(intNum) End If End Sub Function f(X as Integer)As Integer If X<10 Then Y=X Else Y=X+10 End If f=Y End Function Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X as Single,Y As Single) Flag=True End Sub 运行程序,首先单击窗体,然后单击命令按钮,在输入对话框中输入5,则程序的输出结果为______。A.0B.5C.15D.无任何输出
考题
在窗体上画一个名称为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
考题
( 28 )在窗体上画一个命令按钮(名称为 Command1 ) ,并编写如下代码:Functin Fun1(Byval a As Integer ,b As Integer) As IntegerDim t As Integert=a-bb=t+aFun1=t+bEnd FunctionPrivate Sub Command1_Click()Dim x As IntegerX=10Print Fun1(Fun1(x,(Fun1(x,x-1))),x-1)End Sub程序运行后,单击命令按钮,输出结果是A ) 10B ) 0C ) 11D ) 21
考题
在窗体中有一个命令按钮command1,编写事件代码如下: Private Sub Command1_Click() Dim s As Integer s=P(1)+P(2)+P(3)+P(4) Debug.Print s End Sub Public Function P(N As Integer) Dim Sum As Integer Sum=0 For i=1 To N Sum=Sum+1 Next i P=Sum End Function 打开窗体运行后,单击命令按钮,输出的结果是( )。A.15B.20C.25D.35
考题
在窗体上画一个命令按钮,名称为Command1,然后编写如下代码: Option Base() Private Sub Command1 Click() Dim A(4)As Integer,B(4)As Integer For k=0 To 2 A(k+1)=InputBox(“请输入一个整数”) B(3-k)=A(k+1) Next k Print B(k) End sub 程序运行后,单击命令按钮,在输入对话框中分别输入2、4、6,输出结果为______。A.0B.2C.3D.4
考题
在窗体上画一个命令按钮,其名称为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程序运行后,单击命令按钮,消息框的输出结果为______。
考题
在窗体中添加一个名称为Command1的命令按钮,然后编写如下代码: Function F(a As Integer) b=0 Static c b=b+1 c=c+1 F=a+b+c End Function Private Sub Command1 Click() Dim a As Integer Dim b As Integer a=2 For i=1 To 3 b=F(A) Print b Next i End Sub 程序运行后,如果单击按钮,则在窗体上显示的内容是A.4 4 4B.4 5 6C.5 6 7D.5 5 5
考题
在窗体上画一个命令按钮,然后编写如下程序 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
考题
在窗体上画一个命令按钮(名称为Command1),并编写下列代码: Function Fun1(ByVa1 a As Integer,b As Integer)As Integer Dim t As Integer t=a-b b=t+a Fun1=t+b End Function Private Sub Command1Click( ) Dim X As Integer x=10 Print Fun1(Vun1(X,(Fun1(x,x-1))),x-1) End Sub 程序运行后,单击命令按钮,输出结果是( )。A.10B.0C.11D.21
考题
在窗体上画一个命令按钮,其名称为Commandl,然后编写如下程序:Function a(x As Integer, y As Integer) As Integera = IIf(x > y, x, y)End FunctionPrivate Sub Command1_Click()Dim n As Integer, m As Integern = 10m = 20Print a(n, m)End Sub程序运行后,单击命令按钮,输出结果是______。
考题
在窗体上画一个名称为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
考题
在窗体上画—个命令按钮(名称为Command1),并编写如下代码:Function Fun1 (ByVala As Integer, b As Integer)As Integer Dim t As Integer t=a-b b=t+ a Fun 1=t+ bEnd FunctionPrivate Sub Command1_ Click() Dim x As Integer x=10 Print Fun1(Fun1 (x,(Fun1(x,x-1))),x-1)End Sub程序运行后,单击命令按钮,输出结果是 ______。A.10B.0C.11D.21
考题
在窗体上画一个名称为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
考题
在窗体上画一个名称为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_C1ick() 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
考题
在窗体上画一个名称为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.提示出错
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function f(m As Integer) If m Mod 2 = 0 Then f = m Else f = 1 End If End Function Private Sub Command1_Click() Dim i As Integer s = 0 For i = 1 To 5 s = s + f(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是A. 11B.10C.9D.8
考题
在窗体上画一个命令按钮,然后编写如下程序: Private Sub Commandl_Click( ) Dim a AS Integer,b As Integer a=15 b=2 t N(a,B)End Sub Function N(x As Integer,y As Integer) As Integer N=IIf(x)y,x,y) End Function 程序运行后,单击命令按钮,输出结果为A.1B.2C.15D.8
考题
在窗体上画一个命令按钮,然后编写如下程序 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
考题
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序 Dim y As Integer Private Sub Command1_Click() Dim x As Integer X=2 Text1.Text=Fun2(Fun1(x),y) Text2.Text=Fun1(x) End Sub Private Function Fun1(x As Integer)As Integer x=x+y:y=x+y Fun1=x+y End Function Private Function Fun2(x As Integer,y As Integer)As Integer Fun2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Textl和Text2内的值分别是A.2 4 2 4B.2 4 4 8C.10 10 58 58D.4 4 8 8
考题
在窗体上添加一个命令按钮(名为Command1),然后编写如下程序:Function m(x as Integer,y as Integer) as Integerm=IIf(x>y,x,y)End FunctionPrivate Sub Commandl Click()Dim a as Integer,b as Integera=1b=2MsgBox m(a,B)End Sub打开窗体运行后,单击命令按钮,消息框的输出结果为【 】。
热门标签
最新试卷