好文档 - 专业文书写作范文服务资料分享网站

南京工业大学VB期末考试模拟题6

天下 分享 时间: 加入收藏 我要投稿 点赞

. .

安全土木化工化学vb练习题4

满分:111分

:________

1、单项选择题(本题共计60分)

1、在过程调用中,参数的传递可以分为________________和________________两种方式。 ( )

A、按值传递 按地址传递 B、按地址传递 按参数传递 C、按参数传递 按值传递 D、按位置传递 按参数传递

2、下面的过程定义语句中合法的是________________________。 ( )

A、Sub Procl (ByVal n () ) B、Sub Procl ( n ) As Integer C、Function Procl (Procl ) D、Function Procl (ByVal n )

3、在参数传递过程中,使用关键字________________来修饰参数,可以使之按值传递。 ( )

A、ByVal B、ByRef C、Value D、Reference

4、要想在过程调用后返回两个结果,下面的过程定义语句合法的是________________。( )

A、Sub Procl ( ByVal n , ByVal m) B、Sub Procl ( n , ByVal m) C、Sub Procl ( n , m) D、Sub Procl ( ByVal n , m)

5、通用过程可以通过执行“工具”菜单中的____________命令来建立。 ( )

A、添加过程 B、通用过程 C、添加窗体 D、添加模块

6、可以在窗体模块的通用声明段中声明的是________________。 ( )

A、全局变量 B、全局常量 C、全局数组

D、全局用户自定义类型

7、当运行程序时,系统自动执行启动窗体的____________事件过程。 ( )

A、Load B、Click C、UnLoad D、GotFocus

. . .

. .

8、在语句Public Sub Sort(i As Integer)中i是一个按________传递的参数。 ( )

A、地址 B、值 C、变量 D、常量

9、下列定义Sub过程的语句中,正确的语句是____________。 ①Private Sub Test(St As String * 8) ②Private Sub Test(Sarray( ) As String * 5) ③Private Sub Test(Sarray( ) As String) ④Private Sub Test(St As String) ( )

A、①② B、①④ C、②③④ D、①②③④

10、在窗体模块的通用声明处有如下语句,会产生错误的语句是____________。 ①Const A As Integer=25 ②Public St As String * 8 ③ReDim B(3) As Integer ④Dim Const X As Integer=10 ( )

A、①② B、①③ C、①②③ D、②③④

11、在窗体Form1中用“Public Sub Fun(x As Integer,y As Single)”定义过程Fun,在窗体Form2中定义了变量i为Integer,j为Single,若要在Form2的某事件过程中调用Form1中的Fun过程,则下列语句中,正确的语句有____________个。 ①Call Fun(i,j) ②Call Form1. Fun(i,j) ③Form1.Fun(i),j ④Form1.Fun i+1,(j) ( )

A、1 B、2 C、3 D、4

12. 某过程的说明语句中,正确的数组说明语句是____________。 Const N as integer=4 Dim L as integer

①.Dim X (L) As Integer ②.Dim A(K) As Integer Const K As Integer=3 ③.Dim B(N) As Integer

④.Dim Y(2000 To 2008) As Integer

A. ①②④ B. ①③④ C. ③④ D. ②③

. . .

. .

13、程序中的不同过程之间,不能通过____________进行数据传递。 ①全局变量 ②窗体或模块级变量 ③形参与实参结合 ④静态变量 ( )

A、①②④ B、①②③ C、②④ D、④

14、调用由语句Private Sub Convert(Y As Integer)定义的Sub过程时,以下不是按值传递的语句是____________。 ( )

A、Call Convert ((X)) B、Call Convert(X*1) C、Convert (X) D、Convert X

15、Sub过程和Function过程最根本的区别是________________。 ( )

A、Sub过程可以使用Call语句或直接使用过程名调用,而Function过程不可以 B、Function过程可以有参数,Sub过程不可以 C、两种过程参数的传递方式不同

D、Sub过程的过程名不能返回值,而Function过程能通过过程名返回值

16、在窗体模块的通用声明段中声明变量时,不能使用____________关键字。 ( )

A、Dim B、Public C、Private D、Static

17、假定已定义了一个过程Sub Add(a As Single, b As Single),则正确的调用语句是________。 ( )

A、Add (12 , 12)

B、Call Add( 2 * x , Sin(1.57) ) C、Call Add x , y D、Call Add(12 ,12, x)

18. 单击一次命令按钮后,下列程序代码的执行结果为_______ Private Sub proc(a() As Integer) Static i As Integer

Do a(i) = a(i) + a(i + 1) i= i + 1

Loop While i < 2 End Sub

Private Sub Command1_Click()

Dim m As Integer, i As Integer, x(10) As Integer For i = 0 To 4 x(i) = i + 1 Next i

For i = 1 To 2 Call proc(x) Next i

For i = 0 To 4

. . .

. .

Print x(i) Next i End Sub

A. 3 4 7 5 6 B. 3 5 7 4 5 C. 1 2 3 4 5 D. 1 2 3 5 7

19、如下程序,运行的结果是____________。 Dim a%,b%,c%

Public Sub pl(x%,y%) dim c% =2*x : y=y+2 : c=x+y End Sub

Public Sub p2( x%,ByVal y%) dim c%

x=2*x : y=y+2 : c=x+y End Sub

Private Sub Commandl_Click( a=2: b=4: c=6 call pl(a,b)

print \call p2(a,b)

print \End Sub ( )

A、a=2 b=4 c=6 a=4 b=6 c=10 B、a=4 b=6 c=10 a=8 b=8 c=16 C、a=4 b=6 c=6 a=8 b=6 c=6 D、a=4 b=6 c=14 a=8 b=8 c=6 20、设有如下说明: Public Sub Fl(n%) … n =3*n+4 … End Sub

Private Sub Commandl_Click() Dim n%, m% n=3

. . .

. .

m =4 …

' 调用F1语句 End Sub

则在Commandl_C1ick事件中有效的地址传递的调用语句是 。 ( )

A、F1 n+m B、F1 m C、F1 5 D、F1 m+5

21、窗体的Name属性为Frm1,在窗体模块通用声明处和过程Sub1中分别用Public K As Integer,Dim K As Integer声明了两个同名变量K,则在过程Sub1中要访问全局变量K,可采用 ________。 ( )

A、Frm1.K B、Form.K C、Form1.K D、K

22、要使Print方法在FormLoad事件中起作用,要对窗体的____________属性进行设置。 ( )

A、BackColor B、ForeColor C、AutoRedraw D、Caption

23、在调用Sub过程或Function过程时,采用________________传送相应过程的变量名、数组名、常数或表达式。 ( )

A、形式参数 B、实际参数 C、对象参数 D、数组参数

24、以下有关Sub过程与Function过程的区别,正确的是________。 ( )

A、Sub过程可以使用Call语句或直接使用过程名调用,而Function过程不可以 B、Function过程可以有形参,Sub过程不能有形参 C、两种过程参数传递方式不同

D、Sub过程没有返回值,Function过程能返回值

25、给出下列程序代码,在单击命令按钮时的输出结果是________。 Private Sub Command1_Click ( ) Dim x As Integer, y As Integer x=1:y=1 For n=1 TO 3 z=FirstFunc (x, y) Print n, z , Next n End Sub

Private Function FirstFunc (x As Integer, y As Integer) As Integer Dim n As Integer

. . .

南京工业大学VB期末考试模拟题6

..安全土木化工化学vb练习题4满分:111分:________1、单项选择题(本题共计60分)1、在过程调用中,参数的传递可以分为________________和______________
推荐度:
点击下载文档文档为doc格式
06sqs5b29s7f1wl0k4bu3bj0w6iihw013jl
领取福利

微信扫码领取福利

微信扫码分享