首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tStrAs String,strLAs Integer tStr="" strL=Len(xStr)i=1 Do Whil
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tStrAs String,strLAs Integer tStr="" strL=Len(xStr)i=1 Do Whil
admin
2017-06-21
18
问题
设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tStrAs String,strLAs 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/kWGp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码:OptionBase1PrivateSubCommand1_Click()Dima(4,4)Fori=1To4
在用菜单编辑器设计菜单时,必须输入的项是______。
程序运行时,用户向文本框输入内容时,将触发文本框的()事件。
已知a=5,b=8,c=12,下列表达式的值为True的是()。
下列程序的功能是:弹出一个对话框询问用户是否输出,如果是,则输出;否则结束。请填空。SubPrintOut()DimaAsIntegera=MsgBox("输出结果?",vblnformation+vbYesNo,"提
表达式Asc(“A”)&Chr(65)的值为【】。
下列函数调用时弹出的对话框中按钮的个数为【】。MsgBox("程序非法!",vbAbortRetryIgnore,"消息提示:")
设A=2,B=-2,则表达式A/2+1>B+5orB*(-2)=6的值是______。
在窗体上画一个名为Command1的命令按钮。下列程序的功能是:从输入对话框输入一个正整数n。用随机函数产生n个1~100范围的随机数,然后求出去掉一个最大数和最小数的平均数。根据题意,请完善下列程序:PrivateSubCommand1_Click
随机试题
关于书刊装订质量要求的说法,正确的有()等。
作为系统开发的后期阶段,系统实施的目的是把审核过的_______说明书转换为可以实际运行的系统。
级差地租形成的原因是
资本市场促进国有企业转换机制和国有经济的战略性调整,要做到()。
在波士顿矩阵中,能带来大量的净现金流入的产品是()。
人类进入文明社会的标志是()。
注重以服务对象为中心,创造一种有利于服务对象自我发展的辅导环境的个案工作模式是()。
简论人民代表大会制度是我国的根本政治制度。
Wereitnotforyourhelp,theprofitofthecompanythisyear____________(不会比去年翻一翻).
【B1】【B2】
最新回复
(
0
)