首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

设有如下程序:Private Sub Command1 Click()Dim sum As Double,x As Doublesum=0n=0For i=1 To 5

设有如下程序: Private Sub Command1 Click() Dim sum As Double, x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next i End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是()。

A.1+1/2+2/3+3/4+4/5

B.1+1/2+1/3+1/4+1/5

C.1/2+2/3+3/4+4/5

D.1/2+1/3+1/4+1/5

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“设有如下程序:Private Sub Command1 Cl…”相关的问题
第1题
9)设有如下程序: Private Sub Form_Click() Cls a$="ABCDFG" For i=1 To 6 Print Tab(12-i)

9)设有如下程序:

Private Sub Form_Click()

Cls

a$="ABCDFG"

For i=1 To 6

Print Tab(12-i); 【9】

Next i

End Sub

程序运行后,单击窗体,结果如图所示,请填空。

9)设有如下程序: Private Sub Form_Click() Cls a="ABCDFG"

点击查看答案
第2题
设有如下程序:Private Sub Form_Click()Dim i As Integer,x As String,Y As Stringx=”ABCDEFG”Fo

设有如下程序:

Private Sub Form_Click()

Dim i As Integer,x As String,Y As String

x=”ABCDEFG”

For i=4 To 1 Step-1

y=Mid(x,i,i)+y

Next i

Print y

End Sub

程序运行后,单击窗体,输出结果为

A.ABCCDEDEFG

B.AABBCDEFG

C.ABCDEFG

D.AABBCCDDEEFFGG

点击查看答案
第3题
设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:Private Sub Command1_Click() S

设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:

Private Sub Command1_Click()

Static x as integer

X=f(x+5)

Cls

Print x

End Sub

Private function f(x as integer)as integer

F=x+x

End function

连续单击命令按钮3次,第3次单击命令按钮后,窗体上显示的计算结果是

A)10

B)30

C)60

D)70

点击查看答案
第4题
设有如下过程: Private Sub Form. KeyDpwn(KeyCode As Integer,Shift As Integer) Print Chr(Ke

设有如下过程: Private Sub Form. KeyDpwn(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode) End Sub Private Sub Form. KeyUp(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode+2) End Sub 若把窗体的KeyPreview属性设置为True,程序运行后,如果按“A”键,则输出结果为()。

A. A A

B. A B

C. A C

D. A D

点击查看答案
第5题
设有如下程序:Private Sub Command1_Click()DimSum As Double,xAsDoublesum=0n = 0For i= 1 To5x

设有如下程序: Private Sub Command1_Click() Dim Sum As Double, x As Double sum=0 n = 0 For i= 1 To 5 x = n / i n = n + 1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是

A.1+1/2+2/3+3/4+4/5

B.1+1/2+2/3+3/4

C.1/2+2/3+3/4+4/5

D.1+1/2+1/3+1/4+1/5

点击查看答案
第6题
设有如下程序:Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 For

设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是()。

A.1+1/2+2/3+3/4+4/5

B.1+1/2+2/3+3/4

C.1/2+2/3+3/4+4/5

D.1+1/2+1/3+1/4+1/5

点击查看答案
第7题
设有如下程序:Private Sub Command1_Click()DimCAsInteger,d AsIntegerc=4d=InputBox(“请输入一

设有如下程序: Private Sub Command1_Click() Dim C As Integer, d As Integer c=4 d=InputBox(“请输入一个整数”) Do While d>0 If d>c Then c=c+1 End If d=InputBox(“请输入一个整数”) Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、 9和0,则输出结果是

A.12

B.11

C.10

D.9

点击查看答案
第8题
设有如下程序:Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% ForI = L

设有如下程序: Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% For I = Lbound(a)To Ubound(A)If key=a(I)Then index=I Exit Sub End If Next I index=-1 End Sub Private Sub Form_Load() Show Dim b()As Variant Dim n As Integer b=Array(21,64,92,15,72,38,45,72) Call search(b, 45, n) Print n End Sub 程序运行后,输出的结果是

A.2

B.6

C.10

D.12

点击查看答案
第9题
设有如下程序:OptionBase0PrivateSubFormClick()DimaDimiAsIntegera = Array(1,2,3,4,5,6,7,8,9)

设有如下程序: Option Base 0 Private Sub Form Click() Dim a Dim i As Integer a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9) For i = 0 To 3 Print a(5 - i); Next End Sub 程序运行后,单击窗体,则在窗体上显示的是

A.4 3 21

B.543 2

C.6 54 3

D.7 6 54

点击查看答案
第10题
设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double Sum=0 n=0 For i=1

设有如下程序:

Private Sub Command1_Click()

Dim sum As Double,x As Double

Sum=0

n=0

For i=1 To 5

x=n/i

n=n+1

sum=sum+x

Next i

End Sub

该程序通过For循环来计算一个表达式的值,这个表达式是()。

A.1+1/2+2/3+3/4+4/5

B.1+1/2+1/3+1/4+1/5

C.1/2+2/3+3/4+4/5

D.1/2+1/3+1/4+1/5

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改