下列程序的执行结果为 Private Sub Command1_C1ick( ) Dim sl As String,s2 AS String s1="abcdef" Call lnvert(s1,s2) Print s2 End Sub Private Sub lnvert(ByVal xstr As String,ystr As String) Dim tempstr As Stdng i=Len(xstr) Do While i>=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End Sub
A.fedcba
B.abcdef
C.afbecd
D.defabc
第1题:
(31)设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tStr As String, strL As Integer
tStr=""
strL=Len(xStr)
i=1
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名称为 Command1 的命令按钮。然后编写如下的事件过程:
Private Sub Command1_Click( )
Dim S1 As String
S1="abcdef"
Print UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,输出结果是( )。
A)ABCDEF
B)abcdef
C)AFBECD
D)DEFABC
第2题:
下列程序的执行结果为 Private Sub Command1_Click Dim FirStr As String FirSt="abcdef" Print Pat(FirStr. End Sub Private Function Pat(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, 1)+Mid(xStr, strLen -i+1, 1) i=i+1 Loop Pat=tempStr End Function
A.abcdef
B.afbecd
C.fedcba
D.defabc
第3题:
下列程序的执行结果为
Private Sub Command1_Click()
Dim s1 As String, s2 As String
s1= "abcd"
Call Transfer(s1, s2)
Print s2
End Sub
Private Sub Transfer (ByVal xstr As String, ystr As String)
Dim tempstr As String
i=Len(xstr)
Do While i >=1
tempstr=tempstr + Mid(xstr, i, 1)
i=i - 1
Loop
ystr=te mpstr
End Sub( )。
A.dcba
B.abdc
C.abcd
D.dabc
第4题:
下列程序的执行结果是 public class Testff{ public static void main(String args[]){ String sl=new String("I am boy"); String s2=new String("I am boy"); System.out.println(sl==s2); } }
A.真
B.假
C.I am boy
D.都不正确
第5题:
下列程序段: String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1==s2)); 的结果为
A.false
B.true
C.1
D.0
第6题:
在窗体上画一个命令按钮和两个文本框,其名称分别为Command1、Text1和Text2,然后编写如下程序: Dim S1 As String,S2 As String Private Sub Form_Load() Text1.Text="" Text2.Text="" End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) S2=S2 & Chr(Keycode) End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) S1=S1 & Chr(KeyAscii) End Sub Private Sub Command1_Click() Text1.Text=S2 Text2.Text=S1 S1="" S2="" End Sub 程序运行后,在Text1中输入“abc”,然后单击命令按钮,在文本框Text1和Text2中显示的内容分别为______。
A.abc和ABC
B.abc和abe
C.ABC和abc
D.ABC和ABC
第7题:
设有如下程序: 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.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第8题:
单击窗体时,下列程序的执行结果是
Private Sub Invert(ByVal xstr As String, ystr As String)
Dim tempstr As String
Dim I As Integer
I=Len(xstr)
Do While I >=1
tempstr=tempstr + Mid(xstr, I, 1)
I=I - 1
Loop
ystr=tempstr
End Sub
Private Sub Form_Click()
Dim s1 As String, s2 As String
s1= "abcdef"
Invert s1, s2
Print s2
End Sub( )。
A.abcdef
B.afbecd
C.fedcba
D.defabc
第9题:
设有如下通用过程:Public Function Fun (xStr As String) As String Dim tStr As String,strL As Integer tStr=-" " strL=Len(xStr) i=strL/2 Do Whilei<=strL tStr=tStr &id(xStr,i+1,1) i=i+1 Loop Fun=tStr & tStrEnd Function 在窗体上画—个名称为Text1的文本框和—个名称为Command1的命令按钮,然后编写如下的事件过程:Private Sub Command1_ Click() Dim S1 String S1="ABCDEF" Text1.Text=LCase(Fun(S1))End Sub 程序运行后,单击命令按钮,文本框中显示的是 ______。
A.ABCDEF
B.abcdef
C.defdef
D.defabc
第10题:
下列程序的执行结果为
Private Sub Command1_Click()
Dim FirStr As String
FirSt="abcdef"
Print Pat(FirStr)
End Sub
Private Function Pat(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,1)+Mid(xStr,strLen-i+1,1)
i=i+1
Loop
Pat=tempStr
End Function
A.abcdef
B.afbecd
C.fedcba
D.defabc