网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下程序:
PublicSubSwap1(xAsInteger,ByValyAsInteger)
DimtAsInteger
t=x:x=y:y=t
EndSub
PublicSubSwap2(xAsInteger,yAsInteger)
DimtAsInteger
t=x:x=y:y=t
EndSub
PrivateSubCommand1_Click()
DimaAsInteger,bAsInteger
a=10:b=20
Swap1a,b
Print"A1=";a,"B1=";b
a=10:b=20
Swap2a,b
Print"A2=";a,"B2=";b
EndSub
当单击命令按钮后,窗体上输出的结果是( )
A.A1=20B1=10A2=10B2=20
B.A1=10B1=20A2=20B2=10
C.A1=10B1=20A2=10B2=10
D.A1=20B1=20A2=20B2=10
参考答案
更多 “ 以下程序:PublicSubSwap1(xAsInteger,ByValyAsInteger)DimtAsIntegert=x:x=y:y=tEndSubPublicSubSwap2(xAsInteger,yAsInteger)DimtAsIntegert=x:x=y:y=tEndSubPrivateSubCommand1_Click()DimaAsInteger,bAsIntegera=10:b=20Swap1a,bPrintA1=;a,B1=;ba=10:b=20Swap2a,bPrintA2=;a,B2=;bEndSub当单击命令按钮后,窗体上输出的结果是( )A.A1=20B1=10A2=10B2=20B.A1=10B1=20A2=20B2=10C.A1=10B1=20A2=10B2=10D.A1=20B1=20A2=20B2=10 ” 相关考题
考题
( 27 )要想在过程 Proc 调用后返回形参 x 和 Y 的变化结果,下列定义语句中正确的是A ) Sub Proc ( x as Integer,y as Integer )B ) Sub Proc ( ByVal x as Integer, y as Integer )C ) Sub Proc ( x as Integer,Byval y as Integer )D ) Sub Proc ( Byval x as Integer, Byval y as Integer )
考题
阅读以下应用说明及Visual Basic程序代码,将应填入(n)处的字句写在对应栏内。【说明8.1】以下程序的功能是:生成20个200~300之间的随机整数,输出其中能被5整除的数并求出它们的和。【程序代码8.1】Private Sub Command1_Click()For i=1 To 20x=Int((1)*200+100)If (2)=0 ThenPrint xS=S+ (3)End IfNext iPrint"Sum=";SEnd Sub【说明8.2】程序8.2运行后,单击窗体,则在窗体上显示的内容是:a=(4)和b=(5)。【程序代码8.2】Private Sub Form_Click()Dim a As Integer,b As Integera=20:b=50p1 a,bp2 a,bp3 a,bPrint"a=";a,"b=";bEnd SubSub p1(x As Integer, ByValy As Integer)x=x+l0y=y+20End SubSub p2(ByVal×As Integer, y As Integer)x=x+l0y=y+20End SubSub p3(ByVal×As Integer, ByVal y As Integer)x=x+10y=y+20End Sub
考题
以下程序:PublicSubSwap1(ByValxAsInteger,ByValyAsInteger)DimtAsIntegert=x:x=y:y=tEndSubPublicSubSwap2(xAsInteger,yAsInteger)DimtAsIntegert=x:x=y:y=tEndSubPrivateSubCommand1_Click()DimaAsInteger,bAsIntegera=10:b=20Swap1a,bPrintA1=;a,B1=;ba=10:b=20Swap2a,bPrintA2=;a,B2=;bEndSub当单击命令按钮后,窗体上输出的结果是( )A.A1=20B1=10A2=10B2=20B.A1=10B1=20A2=20B2=10C.A1=10B1=20A2=10B2=10D.A1=20B1=20A2=20B2=10
考题
(27)窗体上有两个文本框Text1、Text2以及一个命令按钮Commandl,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1Text=p2(p1(x),y) Text2Text=p1(x) End Sub Private Function pl(x As Integer) As Integer x=x+y:y=x+y pl=x+y End Function Private Function p2(x As Integer,By Val y As Integer) p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为 A.2 4 2 4 B.2 44 8C.4 4 8 8 D.10 1058 58
考题
要想在过程Proc调用后返回形参x和y的变化结果,下列定义语句中正确的是______。A.Sub Proc(x as Integer, y as Integer)B.Sub Proc(By Val x as Integer, y as Integer)C.Sub Proc(x as Integer, By Val y as Integer)D.Sub Proc(By Val x as Integer, By Val y as Integer)
考题
单击一次窗体之后,下列程序代码的执行结果为______。 Private Sub Command1_ Click() Dim x As Integer, y As Integer, z As Integer x = 1: y = 2: z = 3 Call fun1 (x, y, z) Print x; y; z Call fun2(x, y, z) Print x; y; z End Sub Private Sub fun1(x As Integer, y As Integer, z As Integer) x = 10 * z y=z*z+ x z=x+ y+ z End Sub Private Sub fun2 (ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) x=10*z y=z*z+ x z=x+ y +z End SubA.1 2 3 30 39 72B.1 2 3 1 2 3C.30 39 72 1 2 3D.30 39 72 30 39 72
考题
要想在过程Proc调用后返回形参x和Y的变化结果,下列定义语句中正确的是( )。【考点5过程调用与参数传递】A.Sub Proc(x as Integer,Y as Integer)B.Sub Proc(ByVal x as Integer,Y as Integer)C.Sub Proc(x as Integer,ByVal Y as Integer)D.Sub Proc(ByVal x as Integer,ByVal Y as Integer)
考题
以下程序运行后,单击按钮输出结果是 Private Sub Commandl_Click( ) Dim x As Integer,y As Integer,z As Integer X=4:y=2: Z=3 Call Gopd(x,x,z) Print x;X;Z Call Gopd(x,y,y) Print x;y;y End Sub Private Sub Gopd(x As Integer,y As Integer,z As Integer) X=3 * Z + 1 y=2 * z z=x + y End SubA.6 6 12 7 11 11B.8 5 10 5 11 11C.9 6 12 9 10 15D.8 10 10 5 9 10
考题
单击按钮时,以下程序运行后的输出结果是 Private Sub Commandl_Click( ) Dim X As Integer,y As Integer,z As Integer x=1:y=2: Z=3 Call God(x,x,z) Print x;x;z Call God(x,y,y) Print X;y;y End Sub Private Sub God(x As Integer,y As Integer,z As Integer) x=3 * Z + 1 y=2 * Z z=x + y End SubA.6 6 12 7 11 11B.8 5 10 5 11 11C.9 6 12 9 10 15D.8 10 10 5 9 10
热门标签
最新试卷