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

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

有如下程序: Private Sub Commandl_Click( ) a$="A WORKER IS HERE" x=Len(a$) For i=1,To x-1 b$=Mid$(a$,i,3) If b$="WOR" Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为

A.1

B.2

C.3

D.5


参考答案

更多 “ 有如下程序: Private Sub Commandl_Click( ) a$="A WORKER IS HERE" x=Len(a$) For i=1,To x-1 b$=Mid$(a$,i,3) If b$="WOR" Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为A.1B.2C.3D.5 ” 相关考题
考题 下面程序运行后,窗体中显示【 】。Private Sub Command1_Click) ( )aS ="*" :b$ ="$"For k = 1 To 3x$ =Strings (Len(a$) +k,b$ )Print x $;NextPrintEnd Sub

考题 有如下程序:Private Sub Command1_Click()a$= "A WORKER IS HERE"x=Len(a$)For i=1 To x - 1b$=Mid$(a$, i, 3)If b$= "WOR" Then S=S + 1NextPrint SEnd Sub单击命令按钮,程序运行结果为( )A.1B.2C.3D.5

考题 在窗体上画一个名称为Conunandl的命令按钮,然后编写如下程序:Private Sub Commandl_Click()Dimi As Intege,j As IntegerDima(10,10)As IntegerFori=1 To 3Forj=1 To 3a(i,j)=(i-1)*3+jPrinta(i,j);NextjPrintNextiEnd Sub程序运行后,单击A.B.C.D.

考题 设有如下通用过程: Public Sub Fun(a()As Integer,x As Integer) For i=1 To 5 x=x+a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Commandl的命令按钮。然后编写如下的事件过程: Private Sub Commandl_Click() Dim arr(5)As Integer,n As Integer For i=1 To 5 arr(i)=i+i Next Fun arr,n Text1.Text=Str(n) End Sub 程序运行后,单击命令按钮,则在文本框中显示的内容是______。A. 30B.25C.20D.15

考题 (8)下列这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代码,将程序补充完整。Private Sub numCount() Dim num As Integer s$="software And hardware" Num=Len(s$) For i=1 unm b$=。 If b$="a"Then x=x+1 Next i Print"x=";xEnd Sub

考题 (16)在窗体上画一个命令按钮,其名称为Commandl.程序运行后,单击命令按钮,输出结果是 Private Sub p1(n As Integer) For i=n To 1 Step -1 x=String(i,"*") Print x Next i End Sub Private Sub Commandl_Click() P1(3) End SubA.*** ** *B.* ** ***C.* * *D.******

考题 下面程序的输出结果是【 】。Private Sub Commandl_Click( )Dim a(1 To 20)Dim iFori = 1 To 20a(i) = iNext iFor Each i In a( )a(i) = 20Next iPrint a(2)End Sub

考题 设有如下程序: 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

考题 设有如下通用过程:Pubfic Function Fun(xStr As String)As StringDim tStr As String,strL As Integertstr=“”strL=Len(xStr)i=1Do While i=strL/2tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)i=i+1LoopFun=tStrEndFunction在窗体上画一个名称为Commandl的命令按钮。然后编写如下的事件过程:Private Sub Commandl_Click()Dim S1 As StringS1=“abcdef”Print UCase(Fun(S1))End Sub程序运行后,单击命令按钮,输出结果是A.ABCDEFB.abedefC.AFBECDD.DEFABC

考题 有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m "*”:n=n"#" Print x,y,m,n End Sub 程序运行后,输出的结果是A.1 1 * #B.1 1 * #C.1 1 * # 1 1 * # 1 2 * #D.1 1 * # 1 1 * ## 1 2 * ##

考题 执行下面的程序段,x的值为 Private Sub Commandl_Click() For i=1 To 5 a=a+i Next i x=Val(i) MsgBox x End SubA.5B.6C.7D.8

考题 在窗体上绘制一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Commandl_Click() Dim c As Integer,d As Integer d=0 c=6 x=Array(2,4,6,8,10,12) For i=1 To 6 If x(i)>c Then d=d+x(i) c=x(i) Else d=d-c End If Next i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输出的内容为A.10B.16C.12D.20

考题 编写如下事件过程: Private sub sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub1 s1, s2 Print s2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.rehcaetB.tahreeeC.themeeD.eerthea

考题 执行以下程序后输出的是。 Private Sub Commandl_Click ch$ = "ABCDEFGH": Print Mid(Right(ch$, 6), Len(Left(ch$, 4)), 2) End Sub A.CDEFGH B.ABCD C.FG D.AB

考题 下面程序的输出结果是。 Private Sub Commandl_Click ch$=“ABCDEF” proc ch:Print ch End Sub Private Sub proc(ch As Stnng) s=“” For k=Len(ch) TO 1 Step -1 s=sMid(ch,k,1) Next k ch=s End Sub A.ABCDEF B.FEDCBA C.A D.F

考题 有如下程序。 Private Sub Commandl_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1 ( a,B)End Sub Sub Subl(x As Single, y As Single) t=x x=t\y y = t Mod y End Sub 在调用运行上述程序后,a和b的值分别为A.0 0B.1 1C.2D.1 2

考题 下列程序的输出结果是______。Private Sub Commandl_Click()Dim alt(1 To 10)Fori=1 To 10arr(i) =INext iFor Each i In arr()arr(i) =arr(i) *2+1Next iMsgBox arr(7)End Sub

考题 在下面的程序中,要求循环体执行四次,请填空。Private Sub Commandl_Click()x=1Do While【 】x=x+2LoopEnd Sub

考题 下面这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代码完成程序。Private Sub numCount()Dim hum As Integers$ = "software And hardware"num = Len(s$)For i = 1 To humb$=______If b$ = "a" Then x = x+1Next iPrint "x="; xEnd Sub

考题 在窗体中添加一个名称为Commandl的命令按钮,然后编写如下程序: Public x As Integer Private Sub Commandl_click() x=10 Call s 1 Call s 2 MsgBOx x End Sub Pfivate Sub s1() x=x+20 End Sub Private SubA.10B.30C.40D.50

考题 下面程序运行后,输出结果是( )。 Private Sub mysub(b()As Integer,OptionalByValnAsInteger=2) ForI=1 to 4 b(I)=n*I NextI End Sub Private Sub Commandl_Click() Dima(1 to 4)As Integer,I As Integer Callmysub(a(),5) Mysuba() ForI=1 to 4 PrinA.5101520B.2468C.出错D.0000

考题 下列程序的执行结果为 Ptivate Sub Commandl_Click() Dim FirStr As String FirStr="abcdef" Print Pct (FirStr) End Sub Private Function Pct(xStr As String)As String Dim tempStr As String,strLen As Integer tempStr="" strLen=Len(xStr) i=1 Do While i<=Len(xStr)-3 tempStr=tempStr + Mid(xStr,i,l) + Mid(xStr,strLen - i+i ,1) i=i + 1 Loop Pct=tempStr End FunCtionA.abcdefB.afbecdC.fedcbaD.defabc

考题 设有如下程序: 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

考题 以下能够正确计算n!的程序是( )。A.Private Sub Commandl_C1ick()B.hiVate Sub Commandl_C1ick() n=5:x=1 n=5:x=1:i=1 DO DO X=x*1 X=X*1 i=i+1 i=i+1 Loop while i<n Loop While<n Print x Ptinte x End Sub End SubC.Private Sub Commandl_Click ()D.Pdvate Sub Commandl C1ick() n=5:X=1:i=1 n=5=:x=1:i=1 DO DO X=X*1 X=X*1 i=i+1 i=i+1 Loop While i>n Print x Print x End Sub End Sub

考题 有如下程序: Private Sub Command1_Click( ) a$="A WORKER IS OVER THERE" x=Len(a $) For i=1 To x-1 b$=Mid $(a $,i,2) If b $="ER"Then s=s+1 Next i Pdnt s End Sub 程序运行后的输出结果是A.1B.2C.3D.4

考题 单击命令按钮时,下列程序的执行结果是 Private Sub Commandl_Click( ) BT 4 End Sub PriVate Sub BT(x As Integer) X=X * 2 + 1 If x <6 Then Call BT(x) End If X=x * 2 Print x; End SubA.15B.16C.17D.18

考题 9.程序执行结果s的值是 [9] 。Private Sub Commandl_Click()i = 0Doi = i + ls = i + sLoop Until i = 4Print sEnd Sub