首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click() BT 4 End Sub Private Sub BT(x As Integer) x=x*2 + 1 If x < 6 Then Call BT
单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click() BT 4 End Sub Private Sub BT(x As Integer) x=x*2 + 1 If x < 6 Then Call BT
admin
2013-04-11
21
问题
单击命令按钮时,下列程序的执行结果是
Private Sub Command1_Click()
BT 4
End Sub
Private Sub BT(x As Integer)
x=x*2 + 1
If x < 6 Then
Call BT(x)
End If
x=x 2
Print x;
End Sub
选项
A、15
B、16
C、17
D、18
答案
D
解析
此题在函数调用过程中采用了简单递归的方式,具体流程如下:主调过程调用BT过程,把实参4传递给BT过程中的形参x,由x=x2+1语句推出x=9,此时不满足BT过程中判断语句的判断条件,执行x=x2;Print x;语句。由x=x2语句得到x值为18并输出,结束此次调用过程,返回到主调过程结束程序,输出结果为18。
转载请注明原文地址:https://kaotiyun.com/show/1nQp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列叙述中错误的是______。
(1)在窗体上绘制一个名称为Text1的文本框和一个名称为cmd1、标题为“计算”的命令按钮,如图4—3所示。程序运行后,单击“计算”命令按钮,通过在对话框输入整数12,放入整型变量a中,然后计算a!(提示:运算结果应放入Long型变量中),在文本框中显示
请根据以下各小题的要求设计VisualBasic应用程序(包括界面和代码)。(1)在名称为Form1的窗体上放置一个名称为Drivel的驱动列表框控件、一个名称为Dirl的目录列表框控件和一个名称为Filel的文件列表框控件。程序运行时,可以对系统中
(1)在名称为Form1的窗体上画一个命令按钮,名称为commandl,标题为“缩小一半”。编写事件过程,程序运行后,如果单击Commandl命令按钮,则使Comrnandl按钮的长度和宽度各缩小到原来的一半。要求不得使用任何变量。程序运行时的窗体界面如图
下列叙述中正确的是______。
下面叙述正确的是______。
数据流图用于抽象描述一个软件的逻辑模型,数据流图由一些特定的图符构成。下列图符名标识的图符不属于数据流图合法图符的是______。
索引属于()。
索引属于()。
优化数据库系统查询性能的索引设计属于数据库设计的
随机试题
在考生文件夹下有一个数据库文件“samp3.accdb”,里面已经设计了表对象“tEmp”、查询对象“qEmp”和窗体对象“fEmp”。同时,给出窗体对象“fEmp”上两个按钮的单击事件代码,请按以下要求补充设计。将窗体对象“fEmp”上名称为“tP
ADOBEILLUSTRATOR中具有不同填充色和边线色的两个圆形重叠执行"路径寻找器"中的拆分命令后,下列描述正确的是:
生产由________组成()
下列四项中,不合法的IP地址是______。
采血完毕后血液处理及保存程序正确的是
上消化道出血量至少为多少时可出现出血性休克
关于肾上腺的叙述,错误的是
男婴,出生8天。啼哭、哺乳困难,临床检查见患儿两颊黏膜、软腭充血,上有散在的色白如雪的柔软小斑点,针帽大小,斑点稍用力可擦掉。该患儿可能患有的疾病是
2010年,全国国有建设用地土地供应总量42.8万公顷,比上年增长18.4%。其中,工矿仓储用地15.3万公顷,增长7.9%;商服用地3.9万公顷,增长40.4%;住宅用地11.4万公顷,增长40.3%;基础设施等其他用地12.2万公顷,增长10.2%。全
TherewereseveralreasonswhytheIndustrialRevolutionstartedinGreatBritainratherthaninFrance,theothergreatpowers
最新回复
(
0
)