题目内容 (请给出正确答案)
[主观题]

阅读下列程序:Function func(n As Integer)As Integer Sum = 0For i = 1 To n Sum = Sum + (i +

阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为

A.80

B.60

C.70

D.15

提问人:网友ufm2007 发布时间:2022-01-06
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“阅读下列程序:Function func(n As Inte…”相关的问题
第1题
阅读下列程序:Dim SW As BooleanFunction func(X As Integer)As IntegerIf X<20 Then Y=XElse Y=

阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为

A.0

B.20

C.40

D.无任何输出

点击查看答案
第2题
阅读下面的程序;FunctionFunc(x As Integer,y As Integer)As Integer Dim n As Integer Do While

阅读下面的程序; Function Func(x As Integer,y As Integer)As Integer Dim n As Integer Do While n < = 4 x=x + y n = n + 1 Loop Func=x End Function Private Sub Command1_Click() Dim x As Integet, y As Integer Dim n As Integer,z As Integer x=1 y=1 For n = 1 To 6 z=Func(x,y) Next n Print z End Sub 程序运行后,单击命令按钮,输出的结果为.

A.16

B.21

C.26

D.31

点击查看答案
第3题
(27)下列函数过程 Function Func(a As Integer,b As Integer)As Integer Static m As Integer,i
As Integer M=0 i=2 A=i+m+1 b=i+a+b Func2=m End Function Private Sub Command1_Click() Dim p As Integer,k As Integer,m As Integer k=4 m=1 P=Func2(k,m) Print k;m End Sub程序运行后,单击命令按钮,输出结果是 A.3 63 6 B.3 63 11C.3 113 6 D.3 113 11

点击查看答案
第4题
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:Function Func(By Val x As Integer

在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序: Function Func(By Val x As Integer, Y As Integer) y=x*y If y>0 Then Func=x Else Func=y End If End Function Private Sub Command1_Click() Dim a As Integer, b As Integer a=3 b=4 c=Func(a,b)Print" a="; a Print" b="; b Print" c="; c End Sub 程序运行后,单击命令按钮,其输出结果为______。

A.a=3 b=12 c=3

B.a=3 b=4 c=3

C.a=3 b=4 c=12

D.a=13 b=12 c=12

点击查看答案
第5题
在窗体上面一个命令按钮,其名称为Command1,然后编写如下程序:Function Func(ByVal x As Integer,

在窗体上面一个命令按钮,其名称为Command1,然后编写如下程序: Function Func(ByVal x As Integer,y As Integer) y=x*y If y>0 Then Func=x Else Func=y End If End Function Private Sub Command1_Click() Dim a As Integer,b As Integer a=3 b=4 c=Func(a,B)Print"a=";a Print"b=";b Print”c=";c End Sub 程序运行后,单击命令按钮,其输出结果为: ______。

A.a=3 b=12 c=3

B.a=3 b=4 c=3

C.a=3 b=4 c=12

D.a=13 b=12 c=12

点击查看答案
第6题
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:

Dim SW As Boolean

Function func(X As Integer)As Integer

If X<20 Then

Y=X

Else

Y=20+X

End If

func=Y

End Function

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW=False

End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

SW=True

End Sub

Private Sub Command1_Click()

Dim intNum As Integer

intNum=InputBox("")

If SW Then

Print func(intNum)

End If

End Sub

程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案
第7题
在窗体上画一个命令按钮,其名称为Commandl,然后编写如下程序:Function Fonc(By Val x As Integer

在窗体上画一个命令按钮,其名称为Commandl,然后编写如下程序: Function Fonc(By Val x As Integer,y As InteSer) y=x*y If y>0 Then Func=X; Else Func=y End If End Function Private Sub Commandl_Click() Dim a As Integer,b As Integer a=3 b=4 c=Func(a,B) Print"a=";a Print"b=";b Print"C=";C End Sub 程序运行后,单击命令按钮,其输出结果为______。

A.a=3 b=12 c=3

B.a=3 b=4 c=3

C.a=3 b=4 c=12

D.a=13 b=12 c=12

点击查看答案
第8题
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer IfX<20 Then Y=X Else Y=20+X End lf func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As SinSle,Y As Single) SW=True End Sub Prinvate Sub Command1_Click() Dim intNum As Integer intNum=InputBox(””) If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为

A.输出0

B.输出25

C.输出45

D.无任何输出

点击查看答案
第9题
以下用户自定义函数 Function Func(a As Integer, b As Integer) As Integer Static m As Intege

以下用户自定义函数

Function Func(a As Integer, b As Integer) As Integer

Static m As Integer, i As Integer

m=0:i=2

i=i+m+i

m=i+a+b

Func=m

End Function

在窗体上画一个命令按钮,然后编写如下事件过程:

Private Sub Command1

Dim k As Integer, m As Integer,p As Integer

k=4:m=1

P=Func(k,m)

Print p

End Sub

程序运行后,单击命令按钮,输出结果为

A.8

B.9

C.10

D.11

点击查看答案
第10题
以下用户自定义函数Function Func(a As Integer,b As Integer)As IntegerStatic m As Integer.i

以下用户自定义函数 Function Func(a As Integer,b As Integer)As Integer Static m As Integer.i As Integer m=0:i=2 i=i+m+i m=i+a-i-b Func=m End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim k As Integer,m As Integer,p As Integer k=4:m=1 P=Func(k,m) Print P End Sub 程序运行后,单击命令按钮,输出结果为

A.8

B.9

C.10

D.11

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信