首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下事件过程: Private Sub Form_Activate() Dim score(1To3)As Integer Dim i As Integer,t As Variant For i=3To1Step-1 score(i)=2*i Next
编写如下事件过程: Private Sub Form_Activate() Dim score(1To3)As Integer Dim i As Integer,t As Variant For i=3To1Step-1 score(i)=2*i Next
admin
2019-06-20
20
问题
编写如下事件过程:
Private Sub Form_Activate()
Dim score(1To3)As Integer
Dim i As Integer,t As Variant
For i=3To1Step-1
score(i)=2*i
Next i
For Each t In score
Print t:
Next
End Sub
程序运行后窗体上显示( )。
选项
A、6 4 2
B、2 4 6
C、2
D、6
答案
B
解析
本题考查ForEachin循环。For Each in循环格式为:For Each变体变量in数组…Next,For Each in循环在本题中的功能是:依次从数组score中取出每一个元素放到变量t中并输出。数组score中的元素从1到3分别为:2 4 6。
转载请注明原文地址:https://kaotiyun.com/show/Z5Up777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列叙述中有错误的是()。
若已把一个命令按钮的Default属性设置为True,则下面可导致按钮的Click事件过程被调用的操作是
已知图片框Picture1中已装入一个图形,为了在不删除图片框的前提下,清除该图形,应采取的正确操作是
以下叙述中错误的是
在考生文件夹下有一个工程文件sit5.vbp,窗体上有两个标题分别是“读数据”和“统计”的命令按钮。请画两个标签,名称分别为Labell和Label2,标题分别为“出现次数最多的字母是”和“它出现的次数为”;再画两个名称分别为Text1和Text2、初始值
(1)有一个名为samp1.accdb的数据库。试修改职工表“employee”的结构,在“职工号”字段后增加“姓名”字段,其数据类型为文本型,长度为6,并对应职工号添加其姓名,见表2.6。(2)判断并设置表“employee”的主键,刚时将上
对下列二叉树进行前序遍历的结果为()。
下列数据结构中,属于非线性结构的是
在编辑VB应用程序时,如果如果不小心关闭了属性窗口,则可以单击主窗口标准工具栏上的一个按钮直接打开属性窗口,这个按钮的图标是
设子程序过程定义的首部为:PublicSubS(XAsInteger,YAsSingle)则以下正确的调用形式为
随机试题
PowerPoint中系统默认的视图模式是()
Crohn病侵犯肠道的深度为
男50岁,患糖尿病13年,近日并发肺炎。查:心率110次/分,血压12/8kPa(90/60mmHg),呼吸35次/分,呼出气有丙酮味,意识模糊。尿酮体强阳性,血糖27.75mmol/L(500mg/dl)。应选用的药是
长期股权投资采用权益法核算时,初始投资成本大于应享有被投资单位可辨认净资产公允价值份额之间的差额,正确的会计处理是()。
公安机关是人民民主专政的工具,关系着国家安危和社会稳定,只有在党的正确领导下才能正确发挥其职能作用。( )
Ad.AEmbassyVacationResortsCalifornia,FloridaandHawaiiAttheEmbassyVacation
-1/6
一个字符的标准ASCII码的长度是()。
计算机的内存储器与外存储器相比较
—Hello,Alice.You______veryhappy.—Yes.Iamhappy.MyparentsarecomingtoseeMetomorrow.
最新回复
(
0
)