首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的执行结果是( )。 Private Sub Form Activate() Dim score(3)As Integer,total As Integer Dim aa score As Variant score(1)=50:score(
下列程序的执行结果是( )。 Private Sub Form Activate() Dim score(3)As Integer,total As Integer Dim aa score As Variant score(1)=50:score(
admin
2020-06-30
28
问题
下列程序的执行结果是( )。
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,tota 1
Next
End Sub
选项
A、100
2 50 50
3 14 64
4 36 100
B、1 50 50
2 14 64
3 36 100
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
答案
A
解析
本题考查For Each In语句。该语句的使用形式为:ForEach成员 In数组 …Next,适用于不关心数组中的元素个数或者不清楚有多少个元素,使用时要求成员为变体类型变量。当激活窗体时,对score数组中的每个元素进行求和,同时记下当前计算数组元素的个数。默认数组下标从0开始,题中score数组中含有4个元素,输出4行。
转载请注明原文地址:https://kaotiyun.com/show/u1Hp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在窗体上画一个文本框,然后编写如下事件过程:PrivateSubTextl_KeyPress(KeyAsciiAsInteger)DimcharAsStringchar=Chr(K
在窗体上画一个通用对话框,其名称为CommonDialog1,则下列与CommonDialog1.ShowOpen方法等效的语句是( )。
窗体上有名称分别为Text1、Text2的文本框,名称为Command1的命令按钮。运行程序,在Text1中输入"FormList",然后单击命令按钮,执行如下程序:PrivateSubCommand1_Click() Text2.Text=U
下面正确使用动态数组的是()。
在VisualBasic环境下设计应用程序时,系统能自动检查出的错误是( )。
设窗体上有一个名称为List1的列表框,并有若干列表项。下面语句中不能在所有列表项之后追加一个列表项的是
对于能够获得焦点的控件,若要使其不能接收焦点,应该
设工程文件包含两个窗体文件Form1.frm、Form2.frm及一个标准模块文件Module1.bas。两个窗体上分别只有一个名称为Command1的命令按钮。Form1的代码如下:PublicxAsIntegerPrivateSubFo
下列运算符中,优先级最高的是
下列运算符中,优先级别最高的是
随机试题
在Word2010中输入文本时,如需另起一个段落,按下Enter键,系统会产生一个________。
X6132型铣床的最大载重量是___________kg。
企业在达成交易之后,鼓励顾客反馈关于产品满意状况或缺陷的信息并据此给出答复,这属于关系营销的【】层次。
凡疑是糖尿病者均应作如下化验:尿糖定性、空腹血糖清蛋白等,但能确诊糖尿病的化验是()
下列计量器具中,属于B类范围的是()。
某公司企业所得税税率为33%,1999年度从联营企业分回税后利润为37万元,联营企业的企业所得税税率为15%(根据当地的优惠政策,实际只缴纳了7.5%的所得税)。该公司从联营企业分回的税后利润应补企业所得税是()万元。
下列关于工作分析的说法中错误的是()。
在专业服务得到良好的计划、监督及管理的前提下,会计师事务所在确定收费时应当主要考虑下列()因素。
Pentium微处理器在保护模式下,逻辑地址由段选择子和【】两个部分组成。
Collisionbetweenanaircraftandoneormorebirdsistermedabird-strike.Pilotssometimesrecordabirdstrikewhileatcruis
最新回复
(
0
)