首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
窗体中有命令按钮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
2019-08-01
30
问题
窗体中有命令按钮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://jikaoti.com/ti/ZZ5iFFFM
本试题收录于:
二级Access题库NCRE全国计算机二级分类
0
二级Access
NCRE全国计算机二级
相关试题推荐
处于量变过程中的事物保持质的稳定性,这种变化是
(2018年第20题)与第二次世界大战之前的资本主义相比,当代资本主义生产关系中的社会阶层、阶级结构发生了许多新的变化,主要表现在
设xOy平面的第一象限中有曲线Γ:y=y(x),过点y′(x)>0.又M(x,y)为Γ上任意一点,满足:弧段的长度与点M处Γ的切线在x轴上的截距之差为(Ⅰ)导出y=y(x)满足的积分、微分方程和初始条件;(Ⅱ)求曲线Γ的表达式.
适当选取函数φ(x),作变量代换y=φ(x)u,将y关于x的微分方程y=0化为u关于x的二阶常系数线性齐次微分方程+λu=0.求φ(x)及λ,并求原方程的通解.
设4阶矩阵A=(α1,α2,α3,α4),已知齐次方程组AX=0的通解为c(1,-2,1,0)T,c任意.则下列选项中不对的是
现要查询C01课程考试成绩最高的前3名学生的学号和成绩(包括并列的情况)。请补全下列语句:SELECT【4】3学号,成绩FROM选课表WHERE课程号=′C01′ORDERBY成绩DESC
假定要建立一个关于篮球职业联盟的数据库,需管理如下信息:·每个球队有球队名称、所在城市;·每位球员有球员姓名、薪酬;·每场比赛有比赛编号、比赛时间、比赛结果、参加比赛的主场球队、参加比赛的客场球队。其中带下划线的属性是唯一标识。其他需满足的要求如下
应用程序编写不当可能导致数据库中出现死锁,由于死锁导致的事务回滚属于数据库故障中的【10】故障。
设有关系模式W(C,P,S,G,T,R),其中各属性的含义是:C为课程,P为老师,S为学生,G为成绩,T为时间,R为教室,根据定义有如下的函数依赖集:F={C→G,(S,C)→G,(T,R)→C,(T,P)→R,(T,S)→R}W的规范程度可高达【10
下列数据结构中,能用二分法进行查找的是()。
随机试题
腕管综合征的物理治疗最佳组合包括
患者,女,25岁,停经50天,阴道少量出血1周,加重半天,就诊时阴道出血中等量,小腹坠痛,阵发性加重,腰痛如折,查尿HCG(+)。应诊断为
呈扁长卵形、边缘薄、基部钝圆而渐狭,表面黄棕色至红棕色、密布颗粒状的药材是
当项目实际工程量与估计工程量没有实质性差别时,由承包人承担工程量变动风险的合同形式有()
税务机关在对某企业进行纳税检查过程中,发现该单位在经营期间偷逃增值税50000元,税务机关对其作出追缴税款、加收滞纳金并处以25000元罚款的处理决定,并送达处罚决定及处理决定书,该纳税人对上述征税行为不服向上一级税务机关申请复议,其可在结清税款、滞纳
要在最短的时间内向学生呈现、介绍大量而系统的信息可采用的教学方法是()
能真正删除当前库文件中所有记录的命令是______。
下列程序的输出结果是【】。#include<stdio.h>main(){charb[]="Helloyou";b[5]=0;printf("%s\n",b);}
将考生文件夹下SOUP\HYR文件夹中的文件ASER.FOR复制到考生文件夹下PEAG文件夹中。
Severaltimesofrevisionswill_______beforeafinalproductisproducedforacompetition.
最新回复
(
0
)