首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的执行结果是( )。 Private Sub Form_Activate() Dim score(3)As Integer,total As Integer Dim aa_score As Variant sc
下列程序的执行结果是( )。 Private Sub Form_Activate() Dim score(3)As Integer,total As Integer Dim aa_score As Variant sc
admin
2018-09-19
22
问题
下列程序的执行结果是( )。
Private Sub Form_Activate()
Dim score(3)As Integer,total As Integer
Dim aa_score As Variant
score(1)=50:score(2)=14:score(3)=36
total=0:i=0
For Each aa_score In score
i=i+1
total=total+aa_score
Print i,aa_score,total
Next
End Sub
选项
A、1 0 0
2 50 50
3 14 64
4 36 100
B、1 50 50
2 14 64
3 36 100
C、0 50 50
1 14 64
2 36 100
3 36 100
D、0 0 0
1 50 50
2 14 64
3 36 100
答案
A
解析
本题考查For Each In语句。该语句的使用形式为:For Each 成员 In数组 …Next,适用于不关心数组中的元素个数或者不清楚有多少个元素,使用时要求成员为变体类型变量。当激活窗体时,对score数组中的每个元素进行求和,同时i记下当前计算数组元素的个数。默认数组下标从0开始,题中score数组中含有4个元素,输出4行。
转载请注明原文地址:https://kaotiyun.com/show/e1Fp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
假定有如下的程序段:DimintVarAsIntegerintvar=TruePrintintVar则输出结果是
下面描述不属于软件特点的是
假定有如下事件过程:PrivateSubForm_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)IfButton=2Then
假定在窗体上添加了一个通用对话框控件,其名称为CD1,并有如下程序段:CD1.ShowOpenCD1.DefaultExt="doc"在打开文件的对话框中选择了"c:\file1.txt"文件,则FileTitle属性的值是
关于随机文件,以下叙述中错误的是( )。
设窗体上有一个列表框控件List1,含有若干列表项。以下能表示当前被选中的列表项内容的是( )。
设窗体文件中有下面的事件过程:PrivateSubCommand1_Click() Dims a%=100 PrintaEndSub其中变量a和s的数据类型分别是( )。
某二叉树有5个度为2的节点,则该二叉树中的叶子节点数是()。
随机试题
吾起兵至今,八岁矣,身七十余战。身:
Jameswroteaplay【31】television,aboutanimmigrantfamilywhocametoEnglandfromPakistan,andtheproblemstheyhadinEngl
以下对生活事件的理解错误的是
下列有关保险人的问题中,哪些选项应给以否定的回答?()
吊盘的吊桶喇叭口,除通过吊桶外,还要通过的设备有()。
下列银行业务中,属于中间业务的有()。
在平面直角坐标系中,设A(-2,3),B(3,-2)沿x轴把直角坐标系折成120°二面角后,则AB的长度是().
Whoisthewoman?
Contrasttoresearchers’expectations,dysfunctionalfamilyrelationshipsandpoorcommunica-【M1】_____tionstylesappe
Tobeagoodteacher,youneedsomeofthe【B1】______ofagoodactor.Youmustbeabletoholdtheattentionandinterestofyour
最新回复
(
0
)