首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: Public Function Fun(x Str As String)As String Dim tStr As String,strL As Integer tStr=”” strL=Le
设有如下通用过程: Public Function Fun(x Str As String)As String Dim tStr As String,strL As Integer tStr=”” strL=Le
admin
2019-07-30
41
问题
设有如下通用过程:
Public Function Fun(x Str As String)As String
Dim tStr As String,strL As Integer tStr=””
strL=Len(xStr)i=1
DO While i<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名称为Commandl的命令按钮。然后编写如下的事件过程:
Private Sub Commandl_Click()
Dim S1 As String
S1=”abcdef”:Print UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,输出结果是
选项
A、ABCDEF
B、abcdef
C、AFBECD
D、DEFABC
答案
C
解析
本题通用过程的功能是:从字符串变量xStr值的左右两端同时开始,由外向里每次取出两个字符(左右各一个),组成一个新的字符串。
本题程序运行后,当调用通用过程函数Fun后,返回值应为“afbecd”,转换为大写后在文本框中的显示结果为“AFBECD”。
转载请注明原文地址:https://www.kaotiyun.com/show/04Up777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下面程序运行时,若输入395,则输出结果是()。PrivateSubCmdl_Click()Dima%a=InputBox("请输入一个3位整数")PrintaMod10,a\100,(aMod
窗体上有一个名称为Commandl的命令按钮,其单击事件过程及相关的代码如下:PrivateSubCommandl_Click()DimxAsInteger,yAsIntegerx=Val(InputBox("输入整数"))
下列叙述中正确的是
表达式12/2\4的值是
下列描述中错误的是
数据库管理系统是
编写如下程序:PrivateSubCommandl_Click()DimaAsInteger,bAsIntegera=3:b=2Ifa*b<10Thenb=b+1Elseb=b-1EndIfP
下面关于控件数组的叙述中正确的是
语句DimArt(-2To4)AsInteger所定义的数组的元素个数为
下面不属于软件测试实施步骤的是
随机试题
组织文化的核心层是()
下列《长恨歌》诗句中,属于移情于景的是
髓袢利尿药:
按病因分类,外科疾病可分为________、________、________、________、________、________和________。
既能治风寒头痛,又能治疗鼻渊的药物是
具有下列哪一项条件的材料不能作为抗α、β辐射材料?[2006年第056题]
从18世纪到19世纪末,英国一直处于国际分工中心国家的地位,在资本主义世界对外贸中一直独占鳌头。()
简述评估的总结。
Whatisthepurposetoeatsomegarlicaccordingtothepassage?Itcan______.Whatisalsoagoodmethodtohelpyousleep
Ofallthe【C1】______ofagoodnight’ssleep,dreamsseemtobeleastwithinourcontrol.Indreams,awindowopensintoaworld
最新回复
(
0
)