首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的执行结果是( )。 Private Sub Form Activate0 Dim score(3)As Integer,total As Integer Dim aa_scoreAsVariant s
下列程序的执行结果是( )。 Private Sub Form Activate0 Dim score(3)As Integer,total As Integer Dim aa_scoreAsVariant s
admin
2012-09-07
33
问题
下列程序的执行结果是( )。
Private Sub Form Activate0
Dim score(3)As Integer,total As Integer
Dim aa_scoreAsVariant
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、l 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/oRhp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
下列哪个面向对象程序设计不同于其他语言的主要特点?
下列叙述中正确的是______。
下列四个关于DoEvents语句的叙述中,正确的是______。
数据库的故障恢复一般是由
在窗体上画一个名称为、commonDidog1的通用对话框,一个名称为Command1的命令按钮。要求单击命令按钮时,打开一个保存文稿件的通用对话框。该窗口的标题为”Save",缺省文件名为”SaveFile",在“文件类型”栏中显示*.txt,则能够满足
在结构化方法中,软件功能分解属于下列软件开发中
关系数据库的关系演算语言是以【】为基础的DML语言。
下面关于完全二叉树的叙述中,错误的是______。
设a=5,b=4,c=3,d=2,下列表达式的值是3>2*bOra=cAndb<>cOrc>d
E-R模型的三要素是()。
随机试题
Ifyou’reamaleandyou’rereadingthis,congratulations!You’reasurvivor.Accordingtostatistics,you’remorethantwiceas
颅内肿瘤患者最常见的共有表现是
当前根据我国地区经济发展不平衡的实际状况,社会保险基金统筹的地域范围应以()统筹为宜。
商品市场的需求量通常由()组成。
依据力量素质与运动专项的关系,力量素质可分为绝对力量和相对力量。( )
Teachersneedtobeawareoftheemotional,intellectual,andphysicalchangesthatyoungadultsexperience.Andtheyalsoneed
如果需要制作一个公司员工的名片,应该使用的报表是()。
UVLightCausesSkinCancerDon’tlaughifyouhearaboutkidshidingintheirbasementthissummer.Theymighthavebeenfr
FightingforaBrighterFutureforWomenWhenIwasaskedwhatitmeanstobeawomanrunningforpresident
Accordingtothepassage,oneofthefirststepsinchoosingyourcollegeis______.Theword"harsh"inthefirstlineofthes
最新回复
(
0
)