首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程:Public Function Fun (xStr As String) As String Dim tStr As String,strL As Integer tStr=-" " strL=Len(xStr)
设有如下通用过程:Public Function Fun (xStr As String) As String Dim tStr As String,strL As Integer tStr=-" " strL=Len(xStr)
admin
2009-09-28
15
问题
设有如下通用过程: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
答案
C
解析
Mid(字符串,p,n):从第p个字符开始,向后截取n个字符。p和n都是算术表达式。
“&”:字符串连接运算符,将两个字符串按顺序连接起来。
LCase(字符串):将字符串所有的字母都转换成小写字符。
Len(字符串):返回字符串的长度。
由LCase可知,最后结果为小写字符串,可排除选项A。当Fun过程用语句Fun(S1)调用后,S1的值“ABCDEF”被赋给xStr,执行第一次循环时Mid(xStr,i+1,1)相当 Mid(xStr,4,1),此时tStr=D,执行第二次循环时Mid(xStr,i+1,1)相当于Mid(xStr,5,1),此时tStr=DE,执行第三次循环时Mid(xStr,i+1,1)相当于Mid(xStr,6,1),此时tStr=DEF,执行第四次循环时Mid(xStr,i+1,1)相当于Mid(xStr,7,1),没有取到值,此时tStr=DEF,i的值为7,不满足循环条件,循环结束,Fun=tStr & tStr=DEFDEF,由此判断选项C正确。
转载请注明原文地址:https://kaotiyun.com/show/IS1p777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列关于Java布尔类型的描述中,正确的是()。
下列代码中,将引起一个编译错误的行是()。1)publicclassTest{2)intm,n;3)publicTest(){}4)publicTest(inta){m=a;}5)
当启动Applet程序时,首先调用的方法是()。
下列叙述中,错误的是()。
在Java中,线程的模型就是一个CPU、程序代码和【】的封装体。
一个关系表的行称为【】。
以下各项中不属于Java语言流程控制结构的是()。
下面有关Java代码安全性的叙述,()是对的。Ⅰ:字节码校验器加载查询执行需要的所有类。Ⅱ:运行时解释器执行代码。Ⅲ:在运行时,字节码被加载,验证后在解释器里面运行。Ⅳ:类加载器通过分离本机文件系统的类和从网络导入的类增
由关系数据库系统支持的完整性约束是指【】和参照完整性。
已知二叉树后序遍历序列是dabec,中序遍历序列是debac,它的前序遍历序列是()。
随机试题
咬边产生的原因有电流过大、电弧过长、焊条角度不正确、运条方法不当等。
一个猴群占据某个山头,不让其他猴群进入,这一现象在生态学中称为()
A.近部选穴B.远部选穴C.对证选穴D.对症选穴肾阴不足导致的虚热选肾俞、太溪,体现的选穴规律是
A.急性B淋巴细胞白血病B.急性T淋巴细胞白血病C.急性粒细胞白血病D.急性巨核细胞白血病CD19阳性见于
患者,男,66岁,半身不遂,偏身麻木,舌强言謇,口角歪斜,眩晕头痛,面红目赤,口苦咽干,心烦易怒,尿赤便干,舌质红或红绛,脉弦有力。诊断为中风之中经络,其证型为
判别污水水质的复杂程度属于复杂的依据,下列说法正确的是()。
生产经营单位从事生产经营活动应具备的安全生产条件是:必须遵守《安全生产法》的有关规定和其他有关安全生产的法律、法规,加强安全生产管理,建立、健全生产责任制度,(),确保安全生产。
甲公司2011年至2013年发生的有关交易或事项如下:(1)甲公司于2011年1月2日从其母公司处购入乙公司90%的股权。实际支付价款9000万元。另发生相关交易费用45万元。合并日,乙公司所有者权益的账面价值为11000万元,公允价值为12000万元。
要求:根据所给资料分析企业处理中存在的问题,并计算正确的应纳各种税费,并进行账务调整。(对所有计算过程及结果保留两位小数)资料:济南市区某酒厂,为增值税一般纳税人,具有进出口经营权。主营A牌薯类白酒、B牌啤酒产品境内生产、销售,并向国外出口A牌薯类白酒。薯
荀子指出,“天有常道矣,地有常数矣”“天地合而万物生,阴阳接而变化起”“天行有常,不为尧存,不为桀亡。应之以治则吉,应之以乱则凶”。苟子所表述的观点是
最新回复
(
0
)