题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-22 17:15:22

[单项选择]以下程序的功能是随机产生10个两位的整数:
Option Base 1
Private Sub Command1_Click( )
Dim a(10) As Integer
Dim i As Integer
Randomize
For i = 1 To 10
a(i) = Int(Rnd * 100) + 1
Print a(i)
Next i
End Sub
运行以上程序,发现有错误,需要对产生随机数的语句进行修改。以下正确的修改是( )。
A. a(i)=Int(Rnd * 100)
B. a(i)=Int(Rnd * 90)+10
C. a(i)=Int(Rnd * 100)+10
D. a(i)=Int(Rnd * 101)

更多"以下程序的功能是随机产生10个两位的整数: Option Base "的相关试题:

[填空题]设有以下程序: Option Base 1 Private Sub Command1_Click( ) Dim arr1 ,Max as Integer art1 = Array(12,435,76,24,78,54,866,43) 【14】 = arr1(1) For i = 1 To 8 If arrl(i)>Max Then 【15】 Next i Print "最大值:"; Max End Sub 以上程序的功能是:用Array函数建立一个含有8个元素的数组,然后查找并输出该数组中元素的最大值。
[单项选择]以下程序的输出结果是( )。 Option Base 1 Private Sub Command1_Click( ) Dim a(10),p(3) as Integer k=5 For I-1 to 10 a(i)=I Next I For j=1 to3 p(i)=a(I*j) Next j For I=l to 3 k=k+ p (I)*2 Next I Print k End Sub
A. 33
B. 28
C. 35
D. 37
[单项选择]设有如下程序 Option Base 1 Private Sub Command1_Click( ) Dim a(10)As Integer Dim n As Integer n=lnput Box(“输入数据”) If n<10 Then Call GetArray(a,n) End If End Sub Private Sub GetArray(b( )As Integer,n As Integer) Dim c(10)AsInteger 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 lf Next Print j End Sub 以下叙述中错误的是
A. 数组b中的偶数被保存在数组c中
B. 程序运行结束时,在窗体上显示的是c数组中元素的个数
C. GetArray过程的参数n是按值传送的
D. 如果输入的数据大于10,则窗体上不显示任何信息
[单项选择]以下程序的输出结果是D) 9 12 Option Base 1 Private Sub Command1_Click( ) Dim s(10),p(3)As Integer k=5 For i=1 To 10 a(i)=i Next i For i=1 To 3 p(i)=a(i*i) Next I For i=1 To 3 k=k+ p(i)*2 Next i Print k End sub
A. 33
B. 28
C. 35
D. 37
[填空题]阅读程序; Option Base 1 Private Sub Form_ KeyPress (KeyAscii As Integer) art = Array(268, 542, 693, 365, 489, 147, 852) a1 = arr(1) a2 = 1 If KeyAscii = 13 Then For a = 2 To 6 If arr(i) > a1 Then a1 = arr(i) a2 = i End If Next i End If Print a1; a2 End Sub 程序运行后,按回车键;输出结果是______。
[填空题]阅读下列程序。
Option Base 1
Private Sub Form Click( )
Dim x(3,3)
For j=l to 3
For k=l to 3
If j=k then x(j,k)=l
If j<>k then x(j,k)=k
Next k
Next j
Call fun(x( ))
End Sub
Private Sub fun(x( ) )
For j=1 to 3
For k=1 to 3
Print x(j,k);
Next k
Next j
End Sub
运行程序时,输出结果为 【14】
[单项选择]设有如下程序: 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 bb(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,则窗体上不显示任何信息
[填空题]阅读下列程序。 Option Base 1 Private Sub Form Click( ) Dim x(3,3) For j=l to 3 For k=l to 3 If j=k then x(j,k)=l If j<>k then x(j,k)=k Next k Next j Call fun(x( )) End Sub Private Sub fun(x( ) ) For j=1 to 3 For k=1 to 3 Print x(j,k); Next k Next j End Sub 运行程序时,输出结果为 【14】
[单项选择]阅读程序: Option Base 1 Private Sub Form_Click( ) Dim arr Sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 TO 10 If arr(i)/3=arr(i)/3 Then Sum=Sum+art(i) End If Next i Print Sum End Sub 程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[单项选择]阅读程序:
Option Base 1
Private Sub Form_Click( )
Dim arr Sum
Sum=0
arr=Array(1,3,5,7,9,11,13,15,17,19)
For i=1 TO 10
If arr(i)/3=arr(i)/3 Then
Sum=Sum+art(i)
End If
Next i
Print Sum
End Sub
程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[单项选择]设有如下程序
Option Base 1
Private Sub Command1_Click( )
Dim a(10)As Integer
Dim n As Integer
n=lnput Box(“输入数据”)
If n<10 Then
Call GetArray(a,n)
End If
End Sub
Private Sub GetArray(b( )As Integer,n As Integer)
Dim c(10)AsInteger
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 lf
Next
Print j
End Sub
以下叙述中错误的是
A. 数组b中的偶数被保存在数组c中
B. 程序运行结束时,在窗体上显示的是c数组中元素的个数
C. GetArray过程的参数n是按值传送的
D. 如果输入的数据大于10,则窗体上不显示任何信息
[填空题]设有程序: Option Base 1 Private Sub Command1 Click( ) Dim arrl,Max as Integer arrl=Array(12,435,76,24,78,54,866,43) ______ =arrl(1) For i=1 To 8 If arrl(i)>Max Then_______ Next i Print“最大值是:”;Max End Sub 以上程序的功能是:用Atray函数建立一个含有8个元素的数组,然后查找并输出该数组中元素的最大值。请填空。
[填空题]有如下程序: Option Base 1 Private Sub Form_Click( ) Dim arr,sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i) /3=arr(i) /3 Then Sum=Sum+arr(i) End If Next i MsgBox Sum End Sub 程序运行后,单击窗体,消息框的输出结果为______。
[单项选择]设有如下程序:   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
[单项选择]阅读程序:
Option Base 1
Private Sub Form Click( )
Dim arr,Sum
Sum= 0
arr=Array(1,3,5,7,9,11,13,15,17,19)
For i=1 To 10
If arr(i)/3=arr(i)/3 Then
Sum=Sum+arr(i)
End If
Next i
Print Sum
End Sub
程序运行后,单击窗体,输出结果为
A. 13
B. 14
C. 27
D. 15
[填空题]阅读下列程序
Option Base 1
Private Sub Form_Click( )
Dim x(3,3)
For j=1 to 3
For k=1 to 3
If j=k then x (j,k)=1
If j<>k then x(j,k)=k
Next k
Next j
Call fun(x( ))
End Sub
Private Sub fun(x( ))
For j=1 to 3
Fork-1 to 3
Print x(j,k)
Next k
Next j
End Sub
运行程序时,输出结果为 【13】

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码