阅读程序写结果 下载本文

tempStr = tempStr + Mid(xStr, I, 1) 权重:3 + Mid(xStr, strLen - I + 1, 1) I = I + 1 Loop

PickMid = tempStr End Function

Private Sub Command1_Click() Dim FirstStr As String FirstStr = \

Print PickMid(FirstStr) End Sub

答案: afbecd 权重:4 难易度:2

题目:70、 以下程序的输出结果是

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 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

答案:33 权重:2

难易度:2

题目 :71、在窗体上添加一个命令按钮,名为command1,一文本框,名为text1,则执行如下事件过程后,文本框中的输出为( )。

For I = 1 To 4 x = 3

For j = 1 To 3 For k = 1 To 2 x = x + 3 Next k Next j Next I

Text1.Text =str( x)

答案: 21

难易度:2

题目 :72、有如下程序,该程序的执行结果为( )。

Dim k As Integer n = 5 m = 1 k = 1

Do While k <= n m = m * 2 k = k + 1 Loop

Print m

答案: 32 权重:4 难易度:1

题目:73、假定有如下的Sub过程:

Sub S(x As Single,y As

Single)

t = x x =t/y y =t Mod y End Sub

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

Private Sub Commandl_Click

( )

Dim a As Single Dim b As Single a =5 b =4 S a,b Print a,b End Sub

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

答案:1.25,1 权重:2 难易度:1

题目:74、 阅读程序:

Function F(a As Integer)

b = 0 Static c b = b+1 c = c+1 f = a+b+c End Function

Private Sub Commandl_Click () List1.AddItem\Dim a As Integer a =2

For i =1 To 3

Print F(a) Next i End Sub

运行上面的程序,单击命令按钮,输出结果为 。 答案:4

5 6 权重:3 难易度:2

题目:75、阅读程序:

Sub subP(b() As Integer)

For i =1 To 4 b(i)=2*i Next i End Sub

Private Sub Commandl_Click()

Dim a(1 To 4)As Integer a (1)=5 a (2)=6 a (3)=7 a (4)=8 subP a ()

For i =1 To 4

Print a(i) Next i End Sub

运行上面的程序,单击命令按钮,输出结果为 。 答案:2 4 6 8 权重:3 难易度:3

题目: 76在窗体上画一个列表框和一

个文本框,然后编写如下两个事件过程:

Private Sub Form_Load ()

List1.AddItem\List1.AddItem\Listl.AddItem\Text1.Text=\End Sub

Private Sub List1_

DblClick ( )

a =List1.Text

Print a+Text1.Text

End Sub

程序运行后,在文本框中输入“789”(见图1),然后双击列表框中的\,则输出结果为 。 答案:456789 权重:2 难易度:1

题目:77、对窗体编写如下事件过程:

Private Sub Form

_MouseDown(Button As Integer, _

Shift As Integer, X

As Single Y As Single)

If Button =2 Then

Print \End If End Sub

Private Sub Form _

MouseUp(Button As Integer, _

Shift As Integer, X

As Single, Y As Single)

Print \End Sub

程序运行后,如果单击鼠标右键,则输出结果为 。

答案:AAAAA BBBBB 权重:2 难易度:2

题目:78、 对窗体编写如下代码:

Option Base 1 Private Sub

Form_KeyPress(KeyAscii As Integer)

a =

Labell.Caption=

Array(237,126,87,48,498)

m1 = a(1) m2 = 1

If KeyAscii = 13 Then

For i =2 To 5

If a(i)>ml Then

m1 =a(j) m2 =i End If Next i End If Print m1 Print m2 End Sub

程序运行后,按回车键,输出结果为 答案:498 5 权重:2

难易度:2

题目:79、在窗体上画一个命令按钮,名称为Commandl。单击命令按钮时,执行如下事件过 程:

PriVate Sub Commandl—C1icko a$=\ b$=Right(a$,8) c$=Mid(a$,1,8) Msgbox a$,,b$,c$,1 End Sub

则在弹出的信息框的标题栏中显示的信息是

答案:software and hard ware 权重:2 难易度:1

题目:80、在窗体上画一个名称为Listl的列表框,一个名称为Labell的标签。列表框中显示 若干城市的名称。当单击列表框中的某个城市名时,在标签中显示选中城市的名称。

下列能正确实现上述功能的程序是 A) Private Sub

listl_Click() B)Private Sub Listl_C1ick()

list1.listlndex Labell.Nanle=Listl.listindex End Sub .End Sub 答案:A

权重:2

难易度:1

题目 :81、以下程序输出的结果为( )。 X = 1 y = 4

Do Until y > 4 x = x * y y = y + 1 Loop

Print x

答案: 4 权重:4 难易度:1

题目 : 82、在窗体上添加一个按纽,名为command1,然后编写如下的事件过程:( )。

Private Sub Command1_Click() For I = 1 To 4 x = 4

For j = 1 To 3 x = 3

For k = 1 To 2 x = x + 5 Next k Next j Next I Print x End Sub

答案: 13 权重:3 难易度:2

题目 : 83、在窗体上添加一个命令按纽,名为COMMAND1,事件过程如下: Private Sub Command1_Click() x = 0

Do Until c = -1

a = InputBox(\请输入a的值\ a = Val(a)

b = InputBox(\请输入b的值\ b = Val(b)

c = InputBox(\请输入c的值\ c = Val(c)

a = a + b + c Loop

Print a End Sub

程序运行后,单击命令按纽,依次在输入对话框中输入5,4,3,2,1,-1后,输出的结果是( )。

答案: 2 权重:4 难易度:2

题目 : 84、下列程序段的执行结果为( )。 Dim A(3, 3) For M = 1 To 3 For N = 1 To 3

If N = M Or N = 3 - M + 1 Then A(M, N) = 1 Else

A(M, N) = 0 End If Next N Next M

For M = 1 To 3 For N = 1 To 3 Print A(M, N); Next N Print Next M

答案: 1 0 1 0 1 1

1 0 1 权重:3 难易度:2

题目 : 85、单击命令按钮时,下列程序代码的执行结果为( )。

Private Function FirProc(x As Integer, y As Integer, z As Integer) FirProc = 2 * x + y + 3 * z End Function

Private Function SecProc(x As Integer, y As Integer, z As Integer)

SecProc = FirProc(z, x, y) + x End Function

Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer a = 2 b = 3 c = 4

Print SecProc(c, b, a)

End Sub

答案: 21 权重:3 难易度:2

题目 :86、以下程序段中Do?Loop循环执行的次数为( )。 N=5 do

if n mod 2=0 then n=n\\2 else

n=n*3+1 end if

Loop until n=1

答案: 5 权重:2 难易度:2

题目 :87、在窗体上添加一命令按纽,其名为Command1,然后编写代码如下: Private Sub Command1_Click() Dim arr(5) As Integer Dim arr1(5) As Integer n = 3

For I = 1 To 5 arr(I) = I

arr1(n) = 2 * n + I Next I

Print arr1(n); arr(n) End Sub

程序的运行结果为:( )。

答案: 11 3 权重:3 难易度:1

题目 :88、有如下一个Sub过程: Sub mlt(ParamArray numbers()) n = 1

For Each x In numbers n = n * x Next x Print n End Sub

在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a = 1 b = 2 c = 3 d = 4