VB-读程序题(5)

2019-08-26 17:57

C) 55 D) 2332

61、下列程序段的执行结果为 a=95

If a > 60 Then degree=1 If a > 70 Then degree=2 If a > 80 Then degree=3 If a > 90 Then degree=4 Print \

A) degree= 1 B) degree= 2

C) degree= 3 D) degree= 4

62、下列程序段的执行结果为 I=4 x=5 Do

I=I + 1 x=x^ 2

Loop Until I>=7 Print \Print \

A) I=4 x=258694

B) I=7 x=256987

C) I=6 x=365840 D) I=7 x=390625

63、下列程序段的执行结果为 a=5

For k=1 To 0 a=a * k Next k Print k; a

A) -1 6 B) -1 16

C) 1 5 D) 11 21

64、运行下面的程序后,输出的结果为 Cls

Dim t(5, 5) as Integer

For i=1 To 5: t(i, i) =1: Next

For i=1 To 5 For j=1 To 5

Print t(i, j) , Next j Print Next I

A)1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 B) 1

1 1

1 1

C)1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 D) 1 1 1 1 1

65、单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click()

Dim a As Integer, b As Integer, c As Integer a=3 b=4 c=5

Print SecProc(c, b, A) End Sub

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

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

A) 20 B) 25

C) 37 D) 32

66、有如下事件过程:

Function UNC (ByVal x As Integer, ByVal y As Integer) As Integer Do While y <> 0

sic=x / y x=y y=sic Loop UNC=x End Function

以下是该函数的调用过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=12 b=2

x=UNC (a, b) Print x End Sub

A) 0 B) 6

C) 2 D) 80

67、程序运行时,单击命令按钮Command1,标签框1显示( )。

Private Sub Command1_Click() Dim i As Integer, n As Integer For i = 0 To 50 i = i + 3 n = n + 1

If i > 20 Then Exit For Next i

Label1.Caption = Str(n) End Sub A)4 B)5 C)6 D)7

68、编写如下事件过程:

Private Sub Form_KeyDown (KeyCode As Integer, Shift As Integer) Print Chr(KeyCode) End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) Print Chr(KeyAscii) End Sub

在一般情况下(即不按住Shift键和锁定大写键时) 运行程序,若按\键,则程序输出的结果是

A)T T

B) t T

C) T

t D) t t

69、下列程序段的执行结果为 m=2 n=3 Do

m=m + n n=n + 1

Loop While m < 10 Print m; n

A) 1 5 B) 14 6

C) a b D) 10 25

70、 有如下的程序段,该程序段执行完后,共执行的循环次数是 total=0 Counter=1 Do

Print Counter

total=total * Counter+1 Print total

Counter=Counter + 1 If total > 10 Then Exit Do End If

Loop While Counter <=10

A) 4 B) 10

C) 15 D) 20

71、下列程序的运行结果为 Dim a(-1 To 6)

For i=LBound(a, 1) To UBound(a, 1) a(i) =i Next i

Print a(LBound(a, 1) ) ; a(UBound(a, 1) ) A) 0 0 B) -5 0

C) -1 6 D) 0 6

72、单击命令按钮时,下列的执行结果为 Private Sub Command1_Click()

Dim x As Integer, y As Integer x=86: y=29

Call Proc(x, y) Print x; y End Sub

Public Sub Proc(n As Integer, ByVal m As Integer) n=n Mod 10 m=m Mod 10 End Sub

A) 12 32 B) 6 29

C) 2 3 D) 12 3

73、设一个工程由两个窗体组成,其名称分别为Form1和Form2,在Form1上有一个名称为Command1的命令按钮。窗体Form1的程序代码如下:

Private Sub Command1_Click() Dim a As Integer a=10

Call g(Form2,a) End Sub

Private Sub g(f As Form, x As Integer) y=IIf(x>10,000,-100) f.Show f.Caption=y End Sub

运行以上程序,正确的结果是 A)Form1的Caption属性值为100 B)Form2的Caption属性值为-100 C)Form1的Caption属性值为-100 D)Form2的Caption属性值为100

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

Private Sub Command1_Click() Dim x As Integer Static y As Integer x=10 y=5

Call fl(x,y) Print x,y End Sub

Private Sub f1(ByRef x1 As Integer,y1 As Integer) x1=x1+2 y1=y1+2 End Sub

程序运行后,单击命令按钮,在窗体上显示的内容是


VB-读程序题(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:与土有关的典型工程案例 - 图文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: