网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

设有Function过程:

Private Function f(a As Integer, b As Integer) As Integer

a = a * a:

b = b * b

f = CInt(Sqr(a - b))

End Function

则如下程序段的运行结果是( )。

Private Sub Command1_Click()

Dim X As Integer, Y As Integer

X = 5: Y = 4

a = f(X, Y)

Print a

End Sub

A. 5

B. 4

C. 3

D. 9


参考答案

更多 “ 设有Function过程:Private Function f(a As Integer, b As Integer) As Integera = a * a:b = b * bf = CInt(Sqr(a - b))End Function则如下程序段的运行结果是( )。Private Sub Command1_Click()Dim X As Integer, Y As IntegerX = 5: Y = 4a = f(X, Y)Print aEnd SubA. 5B. 4C. 3D. 9 ” 相关考题
考题 单击命令按钮执行下列程序,其输出结果是。 Private Sub Commana1_Click() Dim a As Integer,b As Integer,c As Integer a = 3 b = 4 c = 5 Print SecProc(c,b,a) End Sub Function FirProc(x As Integer,y As Integer,z As Integer) FirProc = 2 * x + y + 3 * z End Function Function SecProc(x As Integer,y As Integer,z As Integer) SecProc = FirProc(z,x,y) + x End FunctionA. 20 B. 22 C. 28 D. 30

考题 单击命令按钮时,下列程序的执行结果为Private Sub Command1_Click()Dim a As Integer, b As Integer, c As Integera=2: b=3: c=4Print P2(c, b, A.End SubPrivate Function P1(x As Integer, y As Integer, z As Integer)P1=2 * x + y + 3 * zEnd FunctionPrivate Function P2(x As Integer, y As Integer, z As Integer)P2=P1(z, x, y) + xEnd Function ( )。A.21B.19C.17D.34

考题 有如下函数过程:Function HFC(ByVal x As Integer, ByVal y As Integer) As IntegerDo While y 0sic=x / yx=yy=sicLoopHFC=xEnd Function以下是该函数的调用过程,该程序的运行结果是Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=HFC(a, B.Print xEnd Sub( )。A.0B.6C.2D.80

考题 下列程序运行后,单击命令按钮,窗体显示的结果为( )。 Private Function pl(x As Integer,y As Integer,z As Integer) pl=2*x+y+3*z End Function Private Function p2(X As Integer,y As Integer,z As Integer) p2=p1(z,y,x)+x End Function Private Sub Commandl_Click()A.23B.19C.21D.22

考题 单击命令按钮时,下列程序代码的执行结果为( )。 Private Function FirProc(x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Funcfion Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Funcfion Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2 b=3 c=4 Printf SecProc(c,b,a) End SubA.21B.19C.17D.34

考题 下列子过程语句中正确的是 A.Sub f1(By Val()As Integer) B.Sub f1(n()As Integer)As Integer C.Function f1(f1 As Integer)As Integer D.Function f1(By Val f As Integer)

考题 数组A在子过程或函数中定义为形参,正确的语句是( )。 A、Private Sub sele(ByVal A( ) As integer)B、Private Function sale(A() As Integer) As StringC、Private Sub sale(A() As Integer) As IntegerD、Private Sub sale(A(i) As Integer)

考题 单击命令按钮时,下列程序的执行结果为 Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer a=2:b=3:C=4 Print P2(c,b,A)End Sub Private Function P1(x As Integer,y As Integer,z As Integer) P1=2 * X + y + 3 * z End Function Private Function P2(x As Integer,y As Integer,z As Integer) P2=P1(z,x,y) + X End FunctionA.21B.19C.17D.34

考题 设有以下函数过程 Private Function Fun(a( )As Integer,b As String)As Integer … End Function 若已有变量声明: Dim x(5)As Integer,n As Integer,ch As String 则下面正确的过程调用语句是( )。A.x(O)=Fun(x."ch")B.n=Fun(n.ch)C.CallFun X,"ch"D.n=Fun(x(5),ch)

考题 设有如下程序: Private Static Function Fac(n As Integer)As Integer Dim f As Integer f=f+n Fac=f End Function Private Sub Form_Click( ) Dim I As Integer For 1=2 To 3 Print"#";I“=”Fac(1) Next I End Sub 程序运行后,单击窗体,在窗体上显示的是A.#2=2 #3=3B.#2=2 #3=5C.#;2=2 #;3=3D.#;2=2 #3;=5

考题 单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click() Dim a As Integer,b As Integer,C As Integer a=3 b=4 c=5 Print SecProc(c,b,A)End Sub Function FirProc (x As Integer,y As Integer,z As Integer) FirProc=2 * x + y + 3 * z+2 End Function Function SecProc (x As Integer,y As hteger,z As Integer) SecProc=FirProc(z,x,y)+x+7 End FunctionA.20B.25C.37D.32

考题 下列过程语句中正确的是( )。A.Sub fl(By Val () As Integer)B.Sub fl(n() As Integer)As IntegerC.Function fl(fl As Integer)As IntegerD.Function fl(By Val f As Integer)

考题 单击命令按钮时,下列程序代码的执行结果为 ( ) Function FirProc(x As Integer, y As Integer, z As Integer) FirProc=2*x+y+3*z End Function Function SecProc(x As Integer, y As Integer, z As Integer) SecProc=FirProc(z, x, y)+x End Function Private Sub Commandl Click() Dim a As Integer, b As Integer, c As Integer a=2 :b=3 :c=4 Print SecProc(c, b,A)End SubA.21B.19C.17D.34

考题 设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEhd Function若已有变量声明:Dim x(5)As Integer,n As Integer,ch As String则下面正确的过程凋用语句是A.x(0)=Fun(x,“ch”)B.n=Fun(n,ch)C.Call Fun x,“ch”D.n=Fun(x(5),ch)

考题 窗体上有一个名为Commandl的命令按钮,并有如下程序:Private Sub Command_Click()Dim a As Integer,b As Integera=8b=12Print Fun(a,b);a;bEnd SubPrivate Function Fun(ByVal a As Integer,b As Integer)As Integera=a Mod 5b=b\5Fun=aEnd Function程序运行时,单击命令按钮,则输出结果是A.3 3 2B.3 8 2C.8 8 12D.3 8 1 2

考题 有如下函数过程。Function UNC(ByVal x As Integer,ByVal y As Integer)As IntegerDo While y<>0S=x/yx=yy=SLoopUNC=xEnd Function以下事件调用该函数,程序运行结果是【 】。Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=UNC(a,b)Print xEnd Sub

考题 下面子过程语句说明合法的是A.Sub f1(s1 As String*8)B.Sub f1(n()As Integer)As IntegerC.Function f1(f1 As Integer)As IntegerD.Function f1(By Val n As Integer)

考题 在窗体上画一个名称为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

考题 下列子过程语句中正确的是( )。A.Sub f1(ByVal() As Integer)B.Sub f1(n() As Integer)As IntegerC.Function f1(f1 As Integer)As IntegerD.Function f1(ByVa1 f as Integer)

考题 有如下函数过程。Function Fun(By Val x As Integer,By Val y As Integer)As IntegerDo While y0reminder=x Mod yx=yy=reminderLoopFun=xEnd Function以下调用函数的事件过程,该程序的运行结果是Private Sub Command7_Click()Dim a As Integer,b As Integera=100:b=25x=Fun(a,B)Print xEnd SubA.0B.25C.50D.100

考题 以下程序运行后,单击命令按钮,窗体显示的结果是 ______。 Private Function p1(x As Integer,y As Integel,z As Integer) p1=2*x+y+3*z End Function Private Function p2(x As Integer,y As Integer,z As Integer) p2=p1(2,y,x)+x End Function Private SubCommandl_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2:b=3:c=4 Print p2(c,b,A)End SubA.19B.21C.22D.23

考题 有如下函数:Private Function firstfunc(x As Integer, y As Integer) As Integer Dim n As Integer Do While n <= 4 x=x +y n=-+1 Loop firstfunc = x End Function调用该函数的事件过程如下:Private Sub Command1_lick() Dim x As Integer Dim y As Integer Dim n As Integer Dim z As Integer x=1 y=1 For n = 1 To 3 z = firstfunc(x, y) Next n Print z End Sub该事件过程的执行结果是 ______。A.1B.3C.16D.9

考题 单击命令按钮执行下列程序,其输出结果是( )。 Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a=3 b=4 c=5 Print SecProc(c,b,A)End Sub Function FirProc(x As Integer, y As Integer, z As Integer) FirProc=2*x+y+3*Z End Function Function SecProc(x As Integer,y As Integer, z As Integer) SecProc=FirProc(z,x,y)+x End FunctionA.20B.22C.28D.30

考题 单击命令按钮时,下列程序代码的执行结果为______。 Private Function FirProc (x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Function Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Function Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim C As Integer a=2 b = 3 c = 4 Print SecProc(c,b,A) End SubA. 21B.19C.17D.34

考题 设有一个命令按钮Command1的事件过程以及一个函数过程。程序如下: Private Sub Command1 Click( ) Static x A S Integer x=f(x+5) Cls Print X End Sub Private Function f(x As Integer)As Integer f=x+x End Function 连续单击命令按钮3次,第3次单击命令按钮后,窗体显示的计算结果是( )。A.10B.30C.60D.70

考题 (23)设有以下函数过程Private Function Fun(a() As Integer, b As String) As Integer...End Function若已有变量声明:Dim x(5)As Integer, n As Integer, ch As String则下面正确的过程调用语句是A)x(o)=Fun(x, "ch")B)n=Fun(n, chC)Call Fun x, "ch"D)n=Fun(x(5), ch)

考题 下列定义Funct函数过程的语句,错误的是()A、Private Public Funct(a)As IntegerB、Static Function Funct(a)C、Private Function Funct(a As Single)D、Function Funct(a As Integer)As Integer