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

设有如下程序: Option Base 1 Private Sub Command1_Click()Dim a(10) As IntegerDim n As Integ

设有如下程序: Option Base 1 Private Sub Command1_Click() Dim a(10) As Integer Dim n As Integer n=InputBox(“输入数据”) If n<10 Then Call GetArray(a,n) End If End Sub Private Sub GetArray(b()As Integer,n As Integer) Dim c(10) As Integer j=0 For i=1 To n b(i)=CInt(Rnd()*100) If b(i)/2=b(i)\2 Then j=j+1 c(j)=b(i) End If Next Print j End Sub以下叙述中错误的是

A.数组b的偶数被保存在数组c中

B.程序运行结束时,在窗体上显示的是c数组中元素的个数

C.GetArray过程的参数n是按值传送的

D.如果输入的数据大于10,则窗体上不显示任何信息

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“设有如下程序: Option Base 1 Private …”相关的问题
第1题
设有如下程序: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

点击查看答案
第2题
设有如下程序: Option Base 1 Private Sub Form. Click() Dim a(5)As String,i As Integer For

设有如下程序: Option Base 1 Private Sub Form. Click() Dim a(5)As String,i As Integer For i=1 To 5 a(i)=Chr(Asc("A")+i) Call f(a,i) Next i End Sub Sub f(ta()As String,n As.Integer) Dim i As Integer For i=1 To n Print ta(i); Next i Print End Sub 对上述程序.以下叙述中正确的是()。

A.程序有错,因为在过程f的定义中数组参数格式不正确

B.程序可正常运行,输出内容的第一行是一个字母“A”

C.程序可正常运行,输出内容的第一行是一个字母“B”

D.程序可正常运行,输出内容的第一行是数字65

点击查看答案
第3题
设有如下程序:Option Base 1Private Sub Command1_Click() Dim a(10) As Integer Dim n As Int

设有如下程序: Option Base 1 Private Sub Command1_Click() Dim a(10) As Integer Dim n As Integer n=InputBox("输入数据") If n<10 Then Call GetArray(a,n) End If End Sub Private Sub GetArray(b()As Integer,n As Integer) Dim c(10)As Integer j=0 For i=1 To n b(i)=Clnt(Rnd()*100) Ifb(i)/2=b(i)\2 Then j=j+1 c(j)=b(i) End If Next Print j End Sub 以下叙述中错误的是()。

A.数组b中的偶数被保存在数组C中

B.程序运行结束时,在窗体上显示的是c数组中元素的个数

C.GetArray过程的参数n是按值传送的

D.如果输入的数据大于10,则窗体上不显示任何信息

点击查看答案
第4题
设有如下程序:Option Base 1PrivateSubCommand1Click()Dima(10)AsIntegerDimnAsIntegern=InputBo

设有如下程序: Option Base 1 Private Sub Command1 Click() Dim a(10) As Integer Dim n As Integer n=InputBox(“输入数据”) If n< 10 Then Call,GetArray(a, n) End If End Sub Private Sub GetArray(b() As Integer, n As Integer) Dim c(10)As Integer j=0 For i=1 To n b(i)=CInt(Rnd()*100) If b(i) /2 =b(i) \2 Then j=j + 1 c(j) = b(i) End If Next Print j End Sub 以下叙述中错误的是

A.数组b中的偶数被保存在数组c中

B.程序运行结束时,在窗体上显示的是c数组中元素的个数

C.GetArray过程的参数n是按值传送的

D.如果输入的数据大于10,则窗体上不显示任何信息

点击查看答案
第5题
有如下程序:Option base 1Private Sub Command1_Click Dim arr(10) Arr=Array(10,35,28,90,54,68

有如下程序:

Option base 1

Private Sub Command1_Click

Dim arr(10)

Arr=Array(10,35,28,90,54,68,72,90)

For Each a In arr

If a>50 then

Sum=sum+a

End If

Next a

End Sub

运行上述程序时出现错误,错误之处是

A)数组定义语句不对,应改为Dim arr

B)没有指明For 循环的终值

C)应在For语句之前增加sum=0

D)Next a 应改为next

点击查看答案
第6题
现有如下一段程序:Option Base 1Privalc Sub Command1 Click() Dim a a=Array(3,5,7,9‘) x=1 F

现有如下一段程序:

Option Base 1

Privalc Sub Command1 Click()

Dim a

a=Array(3,5,7,9‘)

x=1

For i=4,10 j Step-1

s=s+a(i)*X

x=x*10

Next i

Print s

End Sub

执行程序,单击Command1命令按钮键,执行上述事件过程,输出结果是()。

A.9753

B.3579

C.35

D.79

点击查看答案
第7题
在窗体上画一个命令按钮,然后编写如下事件过程:Option Base 1Private Sub Command1_Click()Di

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

Option Base 1

Private Sub Command1_Click()

Dima As Variant

a=Array(1,2,3,4)

j=1

Fori=4 To 1 Step-1

s=s+a(i)*j

j=j*10

Next i

Print s

End Sub

运行上面的程序,单击命令按钮,其输出结果是()。

A、4321

B、12

C、34

D、1234

点击查看答案
第8题
在窗体上面画一个命令按钮,然后编写如下事件过程______ 。Option Base 1Private Sub Command1_Cli

在窗体上面画一个命令按钮,然后编写如下事件过程______ 。 Option Base 1 Private Sub Command1_Click() Dim a a=Array(1,2,3,4) j=1 For i=4 TO 1 Step -1 s=s+ a(i)*j j=j*10 Next i Print s End Sub运行上面的程序,单击命令按钮,其输出结果是______ 。

A.4321

B.12

C.34

D.1234

点击查看答案
第9题
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:Option Base 1Private Sub Command1_

在窗体上画一个名称为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 i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输出的内容为______。

A.10

B.16

C.12

D.20

点击查看答案
第10题
对窗体编写如下事件过程: Option Base 1 Private Sub Form_KeyPress (KeyAScii AS Integer) a

对窗体编写如下事件过程: Option Base 1 Private Sub Form_KeyPress (KeyAScii AS Integer) arr=Array(12,15,18,20,24) m1=arr(1) m2=1 If fKeyAscii=12 Then For i=2 To 5 If arr(i)>m1 Then m1=arr(i) m2=i End If Next i End If Print m1 Print m2 End Sub 程序运行之后按回车键,输出结果为

A.12 1

B.20 2

C.18 5

D.24 12

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