首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tStr As String.strL As Integer tStr="" strL=Len(xStr)i=1
设有如下通用过程: Public Function Fun(xStr As String)As String Dim tStr As String.strL As Integer tStr="" strL=Len(xStr)i=1
admin
2018-10-15
28
问题
设有如下通用过程:
Public Function Fun(xStr 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 Command1_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://jikaoti.com/ti/vym0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
标准模块中用Private声明的过程属于私有过程,只能被它所在的模块中的其他过程调用,不能被工程中其他模块调用,用Public声明的全局变量属于公用变量,可以被工程中的任何模块引用。标准模块的文件扩展名是.bas。可以产生30~50(含30和50)之间
为把圆周率的近似值3.14159存放在变量pi中,应该把变量pi定义为( )。
有下面的函数过程:PrivateFunctionfun(strAsString,chAsString)AsIntegern=0Fork=1ToLen(str)IfMid(str,k
程序流程图中带有箭头的线段表示的是( )。
窗体上有一个名称为Command1的命令按钮,并有如下程序代码:PrivateSubCommand1_Click()Staticaa=1:b=2:c=3Callf(a,b,c)Print
以下能够正常结束循环操作的程序段是
下列符号常量的声明中,不合法的是
有如下程序代码:PrivateSubForm_Click()Dima(3,3)AsIntegerForI=1To3Forj=1To3Ifj>1And
文件列表框中用于设置或返回所选文件路径和文件名的属性是
在窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。运行后的窗体外观如图所示。设有如下的类型和变量声明:PrivateTypePerson nameAsString*8 majorAsSt
随机试题
单击“幻灯片放映”下拉菜单中的“设置放映方式”命令,在“设置放映方式”的对话框中有3种不同的方式放映幻灯片,它们是_______、_______、_______。
男性,27岁,诊断为支原体肺炎,应选用下列哪类药治疗()
A.低钾血症B.低钙血症C.低血糖症D.低氯血症E.低镁血症久泻或营养不良患儿输液后出现精神萎靡、腹胀、肠鸣音减弱.多为
宜采用成本加酬金合同的计价方式的建设工程项目有()。
根据《注册建造师管理规定》,在下列情形中,不予注册的情形包括()。
根据《建设工程安全生产管理条例》,违反其关于机械设备、施工机具和配件出租单位安全责任规定的项目是( )。
决定教育性质的因素是()。
Hissprainedankle______hischancesofwinningthetournament.
Thepaintisstillwet.______!
A、Hemustbejoking.B、Hemightbeserious.C、Hecan’tbecomealawyer.D、Heneedsbusinesstraining.B从该女士的回答可以看出,Steve已多次说他想学一
最新回复
(
0
)