首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
现有如下程序: Private Sub Command1_Click() Public Function f(x As Integer) s=0 If x>=10 T
现有如下程序: Private Sub Command1_Click() Public Function f(x As Integer) s=0 If x>=10 T
admin
2020-01-02
19
问题
现有如下程序:
Private Sub Command1_Click() Public Function f(x As Integer)
s=0 If x>=10 Then
For j=1 To 5 t=x+1
s=s+f(5+i) Else
Next t=x+2
Print s End If
End Sub f=t
End Function
运行程序,则窗体上显示的是
选项
A、38
B、49
C、61
D、70
答案
B
解析
本题考查的考点是有关函数调用和If语句的。要注意在前4次循环中每次调用f函数时传递的参数分别为6、7、8、9,都是小于10的,最后一次循环传递参数10,所以最终结果应该为8+9+10+11+11=49。
转载请注明原文地址:https://kaotiyun.com/show/imTp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
假定有如下情况语句:SelectCaseX能表示|X|>5的Case子句是
编写如下程序:PrivateSubCommand1_Click()DimscoreAsIntegerscore=86Ifscore>85Thenr=1ElseIfsc
设有如下程序:Subf(xAsInteger,ByValYAsInteger)x=2*X:y=y+xEndSubPrivateSubCommand1Click()DimaAsInt
现有如下一段程序:OptionBase1PrivateSubCommand1_Click()Dimaa=Array(3,5,7,9):x=1Fori=4To1Step-1s=s+a
在窗体上画一个名称为Command1的命令按钮。单击命令按钮时执行如下事件过程:PrivateSubCommand1_Click()aS=“softwareandhardware”b$=Right(aS,8)
在窗体上画一个列表框和一个命令按钮,其名称分别为list1和Command1,然后编写如下事件过程:PrivateSubFormload()List1.Addltem”Item1”:List1.Addltem”Itern2”:L
假定一个工程由一个窗体文件Form1和两个标准模块文件Model1和Model2组成Model1的代码如下:PublicxAsInteger:Publicy,AsIntegerSubS1()SubS
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:OptionBase1PrivateSubCommandl_Click()DimaAsVarianta=Array(1,2,3,4,5)Sum=0Fori
随机试题
女,14岁,1年来面色逐渐苍白,半年来月经量增多。1周来反复发热。查体:贫血貌,胸部皮肤有少数出血点,肝脾不大。血象:Hb60g/L,WBC3×109/L,血小板30×109/L。骨髓象:粒比红100:1,未见巨核细胞。估计住院后需用哪项治疗
抽样调查方法是指
髋关节病变检查的首选体位是
A、叶酸B、次黄嘌呤C、谷氨酰胺D、胸腺嘧啶E、天冬酰胺氨甲蝶呤的化学结构类似于
某合伙企业因做生意资金临时周转不足,借了甲3万元钱,而甲与该合伙企业合伙人乙之间因私人纠纷诉至法院,法院最终裁决由乙偿还给甲2万元钱。现甲与该合伙企业做生意,尚欠1万货款,则:
下列属于基金资产估值需考虑的因素是()。
下列有关土地增值税的处理,符合税法规定的有()。
WhenIaskexperiencedcollegeteachersandadministratorstodescribehowcollegestudentshavechangedovertheyears,Ioften
SpaceTourismSpaceTourismisthetermthat’scometobeusedtomeanordinarymembersofthepublicbuyingticketstotrave
Whathappensifyoureleasetheodoroflavenderintoarestaurant?Incaseof【M1】______asmallshopinFrance,atleast
最新回复
(
0
)