首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Option Base 1 Private Sub Command1_Click() Dim c As Integer,d As Integer d=0
在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Option Base 1 Private Sub Command1_Click() Dim c As Integer,d As Integer d=0
admin
2010-03-30
21
问题
在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Option Base 1 Private Sub Command1_Click() Dim c As Integer,d As Integer d=0 c=6 X=Array(2,4,6,8,10,12) For i=1 To 6 If X(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next j Print d End Sub 程序运行后,单击命令按钮,则在窗体上输出的内容为( )。
选项
A、10
B、12
C、16
D、20
答案
2
解析
程序首先使用Array函数为x数组变量赋值,然后利用For循环和If结构语句实现程序功能。程序执行过程如下: ①当i=1时,X()=2;d=d-c=-6;②当i=2时,X(i);d=d- c=-12;③当i=3时,X(i)=6; d=d-c=-18;④当i=4时,X(i)=8;d= d+X(i)=-10;c=8;⑤当i=5时,X(i)=10;d=d+X(i)=0;c=10;⑥当i=6时,X(i)=12;d=d+X(i)=12;c=12。
转载请注明原文地址:https://jikaoti.com/ti/6Uq0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
用来导入己定义好的类或包的语句是()。
2给出下面代码段,x处于()范围时打印字符串“second”。pubhcclassforLoopStatement{publicstaticvoidmain(String[]args){in
下列语句中变量result的结果为()。publicclasstest{publicstaticvoidmain(Stringargs[]){intsum=10;
监听事件和处理事件()。
下列叙述中,错误的是()。
在进行模块测试时,要为每个被测试的模块另外设计两类模块:驱动模块和承接模块(桩模块)。其中【】的作用是将测试数据传送给被测试的模块,并显示被测试模块所产生的结果。
对长度为n的线性表进行顺序查找,在最坏情况下所需要的比较次数为()。
J2SDK中主要有两个相关环境变量,即path和【】。前者指定了JDK命令搜索路径,后者指定了Java类路径。
请完成下列语句中应填的内容:FilepathName=newFile(args[0]);Suing[]fileNames=pathName.【】;
下面不属于软件设计原则的是()。
随机试题
A.窦房结B.心房结C.房室交界D.浦肯野纤维E.心室肌自律性最高的是()
患者,男性,25岁。发生左侧腹部及左下胸部撞击伤3小时。检查:神志清晰,体温37℃,血压80/60mmHg脉率120次/分,左侧腹压痛,有轻度反跳痛及肌紧张血白细胞20×109/L。尿镜检示红细胞20个/HP,正确的急救处理是
下列关于政府预算的表述,正确的有()。
刑事诉讼法规定,对驳回申请回避的决定,可以申请复议的主体不包括:
Ariver’scolorsholdcluestowhatflowsinitswater,fromsoft-greenalgaetoyellow-brownmud.Humaneyesmightmiss【B1】__
"RefrigeratorproductioninChinajumpedfrom1.4millionunitsin1985to10.6millionin1998,"accordingtoDavidFridley,ar
Inlessthanthreedecades"multiculturalism"hasbecomeawordimmediatelyrecognizablebypolicy【M1】______makers,socialcri
GapYearAgapyearisaperiodoftime,usuallyan【T1】______year,whenastudent【T2】______fromformaleducation.Itisoft
StressManagement1.Definitionofstress■Responseofthebodyto【T1】______stimuliorstressors【T1】______■Percept
In1791,GeorgeWashingtonpickedthesiteofthenation’scapital—Washington,D.C.HealsochosethespotwherethePresident’sh
最新回复
(
0
)