首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体中有命令按钮Command1,事件过程如下: Public Function f(x As Integer) As Integer Dim y As Integer x = 20 y = 2 f = x * y End Function
窗体中有命令按钮Command1,事件过程如下: Public Function f(x As Integer) As Integer Dim y As Integer x = 20 y = 2 f = x * y End Function
admin
2020-11-25
24
问题
窗体中有命令按钮Command1,事件过程如下:
Public Function f(x As Integer) As Integer
Dim y As Integer
x = 20
y = 2
f = x * y
End Function
Private Sub Command1_Click()
Dim y As Integer
Static x As Integer
x = 10
y = 5
y = f(x)
Debug.Print x; y
End Sub
运行程序,单击命令按钮,则立即窗口中显示的内容是( )。
选项
A、10 5
B、10 40
C、20 5
D、20 40
答案
D
解析
本题考查的是变量的作用域,程序中命令按钮中的x是用static定义的局部静态变量,只在模块的内部使用,过程执行时才可见。当调用f函数时,所求的f函数的值是f函数中x和y的值乘积,即f函数的值是2*20=40,调用f函数后,原命令按钮中x的值被f函数的值覆盖,即x=20,。最后输出x=20,y=40,故答案为D。
转载请注明原文地址:https://kaotiyun.com/show/X6Sp777K
本试题收录于:
二级Access题库NCRE全国计算机二级分类
0
二级Access
NCRE全国计算机二级
相关试题推荐
在考生文件夹下“samp3.accdb”数据库中己设计好表对象“tEmployee”和“tGroup”及查询对象“qEmployee”,同时还设计出以“qEmployee”为数据源的报表对象“rEmployee”。试在此基础上按照以下要求补充报表设计:
在考生文件夹下,“samp1.accdb”数据库文件中已建立表对象“tVisitor”,同时在考生文件夹下还存有“exam.accdb”数据库文件。试按以下操作要求,完成表对象“tVisitor”的编辑和表对象“tLine”的导入:(1
在考生文件夹下存在一个数据库文件“samp3.accdb”,里面已经设计了表对象“tEmp”、窗体对象“fEmp”、宏对象“mEmp”和报表对象“rEmp”。同时,给出窗体对象“fEmp”的“加载”事件和“预览”及“打印”两个命令按钮的单击事件代码,试按以
在考生文件夹下存在一个数据库文件“samp3.accdb”,里面已经设计好表对象“tStud”,同时还设计出窗体对象“fStud”。请在此基础上按照以下要求补充“fStud”窗体的设计:(1)在窗体的“窗体页眉”中距左边0.4厘米、距上边1.2厘
考生文件夹下存在一个数据库文件“samp2.accdb”,里面已经设计好表对象“tStaff”“tSalary”和“tTemp”。试按以下要求完成设计:(1)创建一个查询,查找并显示职务为经理的员工的“工号”“姓名“年龄”和“性别”四个字段内容,
在考生文件夹下有一个数据文件“samp2.accdb”,里面已经设计好3个关联表对象“tStud”“tCourse”“tScore”和一个临时表“tTemp”及一个窗体“fTmp”。请按以下要求完成设计。(1)创建一个查询,查找并显示没有运动爱好学生的“
下列关于Access查询条件的叙述中,错误的是()。
下列关于二叉树的叙述中,正确的是()。
在创建表时,下列关于“字段大小”属性的叙述中,正确的是()。
下列关于关系数据库中数据表的描述中,正确的是()。
随机试题
“坐位体前屈”指标一般只限于4岁以上的儿童。()
提出语言遗传机制假设的是()
治疗慢阻肺的茶碱类支气管舒张剂的主要不良反应是()。
中国公民王某上街购物,被某国领事馆车辆撞伤,王某即向当地人民法院起诉,请求赔偿损失。本案适用()。
发包方根据建设项目的特点、项目进展情况和控制目标的要求等因素,将建设项目按照一定原则分解,将设计任务分别委托给不同的设计单位,将施工任务分别发包给不同的施工单位,各设计单位和施工单位分别与发包方签订合同,此种模式是( )。
沥青混凝土路面面层的材料组成有()。
()年中国人民银行对银行业金融机构的监管职责移交至新设立的银监会。
20世纪20年代至50年代,西方教育心理学吸取了儿童心理学和心理测验方面的成果,大大扩充了自己的内容。这一时期,教育心理学内容丰富,并成为一门具有独立理论体系的学科。
A、正确B、错误A
ThepassageismainlyaboutthemassprogressandpresenttroubleofhealthysportindustryinIndia.Notallhealthclubsare
最新回复
(
0
)