首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序的执行结果是( )。 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
23
问题
下列程序的执行结果是( )。
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://jikaoti.com/ti/TfO0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
当把框架的何属性设置为False时,其标题会变灰,框架中所有的对象均被屏蔽?
下列叙述中,正确的是
VisualBasic程序设计采用的编程机制是
窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。运行后的窗体外观如图所示。设有如下的类型声明TyPePersonnameASString*8majorASString
以下能够正确计算n!的程序是
在关系模型中,把数据看成一个二维表,每一个二维表称为一个【】。
Sub过程与Function过程最根本的区别是
下列关系模型中,能使经运算后得到的新关系中属性个数多于原来关系中属性个数的是
用某种排序方法对序列(25,84,21,47,15,27,68,35,20)进行排序,记录序列的变化情况如下:15,20,21,25,47,27,68,35,8415,20,21,25,35,
下面不属于软件工程的3个要素的是______。
随机试题
班集体是否有凝聚力,取决于班主任的培养。班主任组织和培养良好的班集体必须做好哪些工作?
建筑工程概算审查的内容包括( )。
在土方工程中,( )常应用于大面积场地平整,开挖大型基坑、填筑堤坝和路基等,最适宜于开挖含水量不超过27%的松土和普通土。
某企业20×6年1月5日将一幢20×4年12月已停用的厂房对外出售。该厂房系20×2年12月投入使用,账面原价为400000元,预计使用期限为5年,预计净残值率为5%,按年限平均法计提折旧。出售时,取得出售收入280000元,按5%的营业税税率计算应缴纳营
以下有关期权价格的决定因素的说法正确的是( )。
“四有、两爱、两精神”的教育目的出自()。
[2002年GRK真题]美国授予发明者的专利数量,由1971年的56000项下降到1978年的45000项。美国在研究和开发方面的投入在1964年到达其顶峰——占GNP的3%,而在1978年只是2.2%,在这期间,研究和开发费用占GNP的比重一直在下降。同
在数据库系统中,用户所见的数据模式为()。
It’sgoodthatWegetupearly.It’sgood_________________________________getupearly.
Fromchildhoodtooldage,wealluselanguageasameansofbroadeningourknowledgeofourselvesandtheworldaboutus.When
最新回复
(
0
)