首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: 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
18
问题
设有如下通用过程:
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://kaotiyun.com/show/04Up777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
以下叙述中错误的是
在下列关系运算中,不改变关系表中的属性个数但能减少元组个数的是
以下叙述中错误的是
以下程序的功能是随机产生10个两位的整数:OptionBase1PrivmeSubCommandl_Click()Dima(10)AsInteger,iAsIntegerRandomizeFori=1To10
下列关于栈的叙述正确的是
设窗体上有Text1、Text2两个文本框,并编写了下面的程序代码:PrivateSubText1_KeyPress(KeyAsciiAsInteger)If"A"<=Chr(KeyAscii)AndChr(KeyAscii)<="Z"Th
PrintFormat(1234.56,"###.#")语句的输出结果是
下面函数的功能应该是:删除字符串str中所有与变量ch相同的字符,并返回删除后的结果。例如:若str=“ABCDABCD”,ch=“B”,则函数的返回值为:“ABCDCD”Functiondelchar(strAsString,chAsStr
设有如下变量声明语句:Dima,bAsBolean则下面叙述中正确的是
下列关于软件工程的描述中正确的是
随机试题
已知齐次线性方程组有非零解,则λ的值为______.
下个月将有来自60个国家的2000多名青少年来本市参加“Robocup2007”(2007世界机器人足球赛)。校学生会计划成立一个120人的志愿者(volunteer)团队。请你写一篇征求志愿者的通知。内容包括;1.征求志愿者的原因:
血站实验室质量体系文件中,关于仪器、设备的维护和使用,说法不正确的是
维生素D缺乏性手足搐搦症在小婴儿中最常见的症状是
患者,男,57岁,症见脘腹胀痛,下痢赤白,里急后重,舌苔黄腻,脉沉实者。治宜选用
数据的离散程度与代表性的关系是()。
某校毕业生分为9个班,每班人数相等。已知一班男生比二、三班女生总数多1。四、五、六班三个班的女生总数比七、八、九班三个班的男生总数多1,那么该校毕业生中男、女人数比是()。
一、注意事项 1.申论考试,与传统作文考试不同,是对分析驾驭材料的能力与对表达能力并重的考试。 2.作答参考时限:阅读资料40分钟,作答110分钟。 3.仔细阅读给定的资料,按照后面提出的“申论要求”依次作答。二、给定资料(1)
为了避免流程图在描述程序逻辑时的灵活性,提出了用方框图来代替传统的程序流程图,通常也把这种图称为()。
PassageThree(1)Oncethepreserveofmonastic(修道院的)retreatsandhardcoremeditators,simplybeingquietisgrowingina
最新回复
(
0
)