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

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

4、下面程序功能是在文本框输入任意字符串,将字符串倒置后在标签显示结果。 例如,输入“ABCDEFG”变换成“GFEDCBA”。 在空白处填入合适的表达式,使程序完整。 Dim i As Integer Label1.Text = "" For i = 1 To Len(TextBox1.Text) Label1.Text = ________ Next

A.Mid(TextBox1.Text, i, 1) & Label1.Text

B.Mid(TextBox1.Text, i, 1)

C.Label1.Text & Mid(TextBox1.Text, i, 1)

D.Label1.Text & TextBox1.Text

E.TextBox1.Text & Label1.Text


参考答案和解析
1解决汉字乱码2提示欢迎学习3设置时区4显示时区和当前时间
更多 “4、下面程序功能是在文本框输入任意字符串,将字符串倒置后在标签显示结果。 例如,输入“ABCDEFG”变换成“GFEDCBA”。 在空白处填入合适的表达式,使程序完整。 Dim i As Integer Label1.Text = "" For i = 1 To Len(TextBox1.Text) Label1.Text = ________ NextA.Mid(TextBox1.Text, i, 1) Label1.TextB.Mid(TextBox1.Text, i, 1)C.Label1.Text Mid(TextBox1.Text, i, 1)D.Label1.Text TextBox1.TextE.TextBox1.Text Label1.Text” 相关考题
考题 下面程序的功能是统计字符串中"i"的个数,请填空。Sub COU()a$="Beijing University of Technology"Dim n As Integern=Len(a$)For i=1 To nb$= 【12】If 【13】 Then x=x + 1Next iPrint "x="; xEnd Sub

考题 在窗体上画一个名称为Label1的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10, 10)As Integer Dimi As Integer, j As Integer For i=2 To 4 For j=2 To 4 arr(i, j)=i*j Next j Next i Label1. Caption=Str(arr(2, 2)+arr(3, 3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是______。A.12B.13C.14D.15

考题 在窗体上画一个名称为Labell的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)As Integer Dim i As Integer,j As Integer For i =2 To 4 For j=2 To 4 arr(i,j)=i*j Next j Next i Labell.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是A. 12B.13C.14D.15

考题 阅读程序: Option Base 1 Dim arr()As Integer Private Sub Form_Click() Dim i As Integer,j As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim Preserve arr(3,4) For j=3 To 4 arr(3,j)=j+9 Next j Print arr(3,2)+arr(3,4) End Sub 程序运行后,单击窗体,输入结果为______。A. 21B.13C.8D.25

考题 下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print xA.3B.4C.5D.6

考题 (33)假定有以下函数过程:Function Fun(S As String)As StringDim s1 As StringFor i=1 To Len(S)s1=LCase(Mid(S, i, 1))+s1Next iFun=s1End Function在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click( )Dim Str1 As String, Str2 As StringStr1=InputBox("请输入一个字符串")Str2=Fun(Str1)Print Srt2End Sub程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体上的输出结果为( )。A)ABCDEFGB)abcdefgC)GFEDCBAD)gfedcba

考题 在窗体上绘制一个名称为Label1的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)As Integer Dim i As Integer,j As Integer For i =2 To 4 For j =2 To 4 arr(i,j)=i*j Next j Next i Label1.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是( )。A.12B.13C.14D.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

考题 下面程序的功能是统计字符串中"i"的个数,请填空。Sub COU( )Dim n As Integera$=" Beijing University of Technology"n=Len(a$)For i=1 To nb$=【 】If b$="i" Then x=x+1NextPrint"x=" ; xEnd Sub

考题 下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。A.33B.28C.35D.37

考题 阅读以下说明及Visual Basic程序代码,将应填入(n)上处的字句写在对应栏内。[说明]字符组合:程序界面如图示,在文本框Text1中输入若干个任意字符,单击“颠倒”按钮,将这些字符按相反的顺序显示在标签Lable1 中,并在标签Labs1 2处显示字符的个数。例如:输入abcabc2,显示为 2cbabca,组成字符数为4。[Visual Basic 代码]Private Sub cmdshow_ Click (Dim n As IntegerDim I As IntegerDim str1 As StringN=Len ( Text1.Text )For I=n To Step- 1Str1=(1)Next ILabe11. Caption=Str1End SubPrivate Sub cmdcount_ Click ( )Dim n As IntegerDim in As IntegerDim i As IntegerDim j As IntegerDim flag As IntegerDim str1 As IntegerDim str2 As IntegerN=(2)Str1 =Mid$ ( Text1.Text, i. 1For I =2 To nStr2=mid$ ( Text1,Text,I,1M=Len (str1)(3)For j=1 To mIf (4) Then flag= 1; Exit ForNext jIf flag<>1 then str1=str1 str2Next ILable2.Caption=(5)End Sub

考题 在窗体上画一个名称为Text1的文本框和一个名称为Commsnd1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim arrayl(10, 10) As Integer Dim i, j as Integer For i = 1 To 3 For j = 2 To 4 arrayl(i, j) = i+j Next j Next i Text11.. Text=array1(2, 3) + array1(3, 4) End Sub程序运行后,单击命令按钮,在文本框中显示的值是( )。A.12B.13C.14D.15

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

考题 假定有以下函数过程: Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1 = UCase(Mid(S, i, 1)) +s1 Next i Fun =s1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim Str1 As String, Str2 As String Strl = InputBox(“请输入一个字符串”) Str2=Fun(Str1) Print Str2 End Sub 程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定” 按钮后在窗体上的输出结果为,A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA

考题 在窗体中添加一个标签LblResult和一个命令按钮Command1,然后编写程序。程序的功能是单击命令按钮,计算1+2+3+4+5的值,并把结果转化为字符串显示在标签内,能够实现上述功能的程序段是, ( )A.Private Sub Command1_Click() Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Name=Str$ (R) End SubB.Private Sub Command1_ClickO Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Caption= Str$ (R) End SubC.Private Sub Command1_Click() Dim I,R As Integer Do While I<5 R=R+I I=I+1 Loop LblResult. Caption=Str$ (R) End SubD.Private Sub Command1_Click() Dim I,R As Integer Do R=R+I I=I+1 Loop While I<5 LblResult. Caption=Str$ (R) End Sub

考题 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写 如下事件过程: Private Sub Command1_Click() Dim arrayl(10,10)As Integer Dim i, j As Integer For i=1 To 3 For j=2 To 4 arrayl(i,j)=i + j Next j Next i Text1.Text=arrayl(2, 3)+arrayl(3, 4) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是A.12B.13C.14D.15

考题 下列程序的功能是:输入10个整数,逆序后输出。请在程序空白处填入适当语句使程序完成指定的功能。Private Sub Command2_Click()Dim i, j, k,temp, arr(11) As lntegerDim result As StringFor k=1 To 10arr(k) =Val (InputBox( "请输入第" k "个数:","数据输入窗口"))Next ki=1j = 10Dotemp=arr(i)arr(i)=arr(j)arr(j)=tempi=i+1j=【12】Loop While【13】result =""For k=1 To 10result=result arr(k) Chr(13)NeXt kMsgBox resultEnd Sub

考题 在窗体上画一个名称为Text1的文本框和一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Dim arrayl(10,10)As Integer Dim i As Integer,j As Integer For i=1 To 3 For j=2 To 4 array l(i,j)=i+j Next j Next i Text1.Text=arrayl(2,3)+arrayl(3,4) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是______。A. 12B.13C.14D.15

考题 执行下列程序段时,分别在输入框中输入2、4、6,则执行结果是______。 Dim A(4) As Integer Dim B(4) As Integer For i = 0 To 2 A(i + 1) = Val (InputBox (“请输入数据”)) B(3 - i) = A(i + 1) Next i Print B(i)A.2B.4C.6D.8

考题 下面这个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

考题 阅读程序: Function fac(ByVal As Integer)As Integer Dim temp As Integer temp=1 For i%=1 To n temp=temp*i% Next i% fac=temp End Function Private Sub Form. Click( ) Dim nsum As Integer nsum=1 For i%=2 T0 4 nsum=nsum+fac(i%) Next i% Print nsum End Sub 程序运行后,单击窗体,输出结果是( )。A.35B.31C.33D.37

考题 在窗体上绘制一个名称为Labell的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)As Integer Dim i As Integer,j As Integer For i=2 To 4 For j=2 To 4 arr(i,j)=i*j Next i Next i Labell.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是A.12B.13C.14D.15

考题 编写如下事件过程: Private Sub Form. Click() Dim Char As String,i As Integer Const ch$="#" msg$= "Enter a String:" char=InputBox$(msg$) n=Len(Char) For i=1 To n If Mid$(char,i,1)=ch$ Then Exit For End If Next i Print i - 1 End Sub 其中InputBox函数的功能是弹出一个输入对话框,按所给参数给出提示,等待用户输入,并返回输入的内容。程序运行后,单击窗体,如果在输入对话框内输入字符串“12ab$%*/#fg”,则窗体上输出A.2B.2C.5D.8

考题 在窗体上画l个命令按钮和l个文本框,其名称为Command1和Text1,再编写如下程序: Dim ss As String Private Sub Text1 KeyPress(KeyAscii As Integer) If Chr(KeyAscii)""Then ss=ss+Chr(KeyAscii) End Sub Private Sub Command1 Click( ) Dim m As String,i As Integer For i=Len(ss)To 1 Step-1 m=m+Mid(SS,i,1) Next Text1.Text=UCase(m) End Sub 程序运行后,在文本框中输入“Number 100”,并单击命令按钮,则文本框中显示的就是( )。A.NUMtBER l00B.REBMUNC.REBM UN l00D.001 REBMUN

考题 在窗体上画—个名称为Label1的标签,然后编写如下事件过程: Private Sub Form_CIick( ) Dim arr(10,10)As Integer Dim i As Integer,j As Integer For i=2 To 4 For j=2 To 4 srr(i,j)=i*j Next j Next i Label1.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是A.12B.13C.14D.15

考题 假定有以下函数过程: Function Fun(S As String) As String Dim s1 As String For i=1 To Len(S) s1=UCase(Mid(S,i,1))+s1 Next i Fun=S1 End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim Str1 As String,Str2 As String Str1=Input Box(“请输入一个字符串”) Str2=Fun(Str1) Print Str2 End Sub 程序运行后,单击命令按钮,如果在输入对话框中输入字符串“abcdefg”,则单击“确定”按钮后在窗体上的输出结果为A.abedergB.ABCDEFGC.gfedcbaD.GFEDCBA

考题 在窗体上画一个名为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim arrayl(10, 10)As Integer Dim i As Integer, j As Integer For i=1 To 3 For j=2 To 4 arrayl(i, j)=i+j Next j Next i Text1. Text=arrayl(2, 3)+arrayl(3, 4) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是______。A.12B.13C.14D.15

考题 下列程序段的执行结果为______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 T0 3 For j=0 To 3 x=x+m(i, j) Next Next Print xA.3B.4C.5D.6