首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
编写如下事件过程: Private Sub Form_Activate() Dim score(1 To 3)As Integer Dim i AS Integer.t As Variant For i=3 T
编写如下事件过程: Private Sub Form_Activate() Dim score(1 To 3)As Integer Dim i AS Integer.t As Variant For i=3 T
admin
2013-10-17
23
问题
编写如下事件过程:
Private Sub Form_Activate()
Dim score(1 To 3)As Integer
Dim i AS Integer.t As Variant
For i=3 To 1 Step-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
解析
本题考查For Each in循环。For Each in循环格式为:For Each变体变量in数组…Next,For Each in循环在本题中的功能是:依次从数组score中取出每一个元素放到变量t中并输出。数组score中的元素从1到3分别为:2 4 6。
转载请注明原文地址:https://kaotiyun.com/show/QUQp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在名为Form1的窗体上绘制一个名为Image1的图像框,利用属性窗口装入考生文件夹中的图像文件Pic1.bmp,并设置适当属性使其中的图像可以适应图像框大小;再绘制两个命令按钮,名称分别为Cmd1、Cmd2,标题分别为“右移”、“下移”。请编写适当的事
在名为Form1的窗体上绘制一个水平滚动条,其名称为HS1,然后通过属性窗口设置窗体和滚动条的属性,实现如下功能:(1)窗体标题为“设置属性”。(2)滚动条所能表示的最小值和最大值分别为1和200。(3)程序运行后,单击滚动条两端的
在名为Form1的窗体上绘制一个图片框,名为Pic1。请编写适当的事件过程,使得在运行时,每单击图片框一次,就在图片框中输出“单击Pic1”一次;每单击图片框外的窗体一次,就在窗体中输出“单击Form”一次。运行时的窗体如下图所示。注意:
在名为Form1的窗体上建立一个名为Cmd1的命令按钮数组,含3个命令按钮,它们的Index属性分别为0、1、2,标题依次为Yes、No和Cancle,每个按钮的高、宽均为400、700。窗体的标题为“Cmd窗口”。运行后的窗体如下图所示。注意
以下关于菜单的叙述中,错误的是______。
下列叙述中正确的是______。
表达式Fix(-32.68)+Int(-23.02)的值为【】。
面向对象的模型中,最基本的概念是对象和【】。
数据结构中,与所使用的计算机无关的是数据的______。
软件需求分析阶段的工作,可以分为4个方面:需求获取、需求分析、编写需求规格说明书以及()。
随机试题
不属于特异性感染的感染性疾病是
结核病最主要的传染源是
围生期包括胎儿期一部分和婴儿期一部分,国内普遍采用的定义是
受热到一定程度就能软化的高聚物是()。
植被现状调查时,一般草本、灌木林、乔木林样方面积应分别不小于()
维生素C(非制剂;非零售包装)()
根据个人所得税法律制度的规定,下列收入中,应按劳务报酬所得税目缴纳个人所得税的是()。
【材料大意】近年来,随着我国工业化、城镇化进程的不断推进,越来越多的农民工涌入城市,他们为城市的发展做出了巨大的贡献。但是随之而来的人口迁移也带来了许多社会问题,尤其是农民工子女教育问题。打工子弟学校是城市为解决外来进城务工人员子女就学开办的学校,这些
选项四个图形中,只有一个是由题干的四个图形拼合(只能通过上、下、左、右平移)而成的,请把它找出来。
对陶渊明“采菊东篱下,悠然见南山”的诗句理解有误的一项是:
最新回复
(
0
)