admin 管理员组

文章数量: 1086019


2024年3月27日发(作者:jsp提交表单的两种方法)

计算机二级(VB)20

(总分1780,考试时间90分钟)

选择题(每小题2分,共70分) 下列各题四个选项中,有一个是正确的,请选择正确答案。

1. 下列说法错误的是( )。

A. Caption不是只读属性,运行时对象的名称可以通过代码改变

B. 设置Height或Width的数值单位为twip,1twip=1/10point

C. Icon属性用来设置窗体最小化时的图标

D. 用来激活属性窗口的快捷键是F4键

2. 下列语句中,不能实现循环100次的是( )。

A. N=0 Do N=N+1 Loop Until N>=100

B. N=0 Do N=N+1 Loop While n<100

C. N=0 N=N+1 Do Loop Until N<100

D. N=0 Do While n<100 N=N+1 Loop

3. 有如下事件过程: Private Sub Commaild1_Click( ) Dim i As Integer

For i =1 To 2 DC Next i End Sub Sub DC( ) Dim x As

Integer,m As String Static y,n x=x + 1 y=y + 1 m=m&"*":

n=n &"#" Print x,y,m,n End Sub 程序运行后,输出的结果是( )。

A. 1 1 * # 1 1 * #

B. 1 1 * # 1 2 * #

C. 1 1 * # 1 1 * ##

D. 1 1 * # 1 2 * ##

4. 数据库DB、数据库系统DBS、数据库管理系统DBMS之间的关系是______。

A. DB 包含 DBS 和 DBMS B. DBMS 包含 DB 和 DBS

C. DBS 包含 DB 和 DBMS D. 没有任何关系

5. 如果要将文本框作为密码框使用时,应设置的属性为( )。

A. Name B. Caption

C. PasswordChar D. Text

6. 以下关于Visual Basic数据类型的说法,不恰当的是( )。

A. char str[ ];

B. char str[ ][ ];

C. String str[ ] = new String[10];

D. String str[10];

7. 在Visual Basic中,要强制用户对所用的变量进行显式声明,这可以在哪里设置?

A. 算术运算符>关系运算符>连接运算符

B. 算术运算符>连接运算符>逻辑运算符

C. 连接运算符>算术运算符>关系运算符

D. 逻辑运算符>关系运算符>算术运算符

8. 要想在过程调用中返回两个结果,下面的过程定义语句合法的是( )。

A. Sub Submit(ByVal n,ByVal m)

B. Sub Submit(n,ByVal m)

C. Sub Submit(n,m)

D. Sub Submit(ByVal n,m)

9. 假定通用对话框的名称为CommonDialog1,命令按钮的名称为Command1,则单击命 令

按钮后,能使打开的对话框的标题为“New Title”的事件过程是______。

A. Private Sub Command1_Click() Title = "New Title"

inter End Sub

B. Private Sub Command1_Click() Title = "New Title"

nt End Sub

C. Private Sub Command1_Click() Title = "New Title"

en End Sub

D. Private Sub Command1_Click() Title = "New Title"

lor End Sub

10. 要获得当前驱动器应使用驱动器列表框的属性是( )。

A. school B. 生日快乐

C. hello.c D. //注释

11. 在默认情况下,InputBox函数返回值的类型为( )。

A. constructAdestructA

B. constructAconstructAdestructAdestructA

C. constructAconstructAconstructAdestructAdestructAdestructA

D. constructAconstructAconstructAconstructAdestructAdestructAdestructAdestructA

12. 有如下的程序段,该程序段执行完后,共执行的循环次数是( )。 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. 该程序完全正确

B. 该程序有错,只要将语句swap(&a,&b);中的参数改为a,b即可

C. 该程序有错,只要将swap( )函数中的形参p和q以及t均定义为指针(执行语句不变)即

D. 以上说法都不对

13. 为了清除窗体上的一个控件,下列正确的操作是______。

A. 按回车键 B. 按Esc键

C. 选择(单击)要清除的控件,然后按Del键 D. 选择(单击)要清除的控件,然

后按回车键

14. 下面程序段执行结果为( )。 x=Iht(Rnd()+4) Select Case x Case 5

Print"excellent" Case 4 Print"good" Case 3 Print"paSS"

Case Else Print "fail" End Select

A. 0 0 B. 1 1

C. 2 2 D. 1 2

15. 下列日期型数据正确的是( )。

A. @January 10,1979@

B. #January 10,1997#

C. "January 10,1997"

D. &January 10,1997&

16. 要使文件列表框中的文件随目录列表框中所选择的当前目录的不同而发生变化,应该

( )。

A. 在File1中的Change事件中,输入File1.Path=Dir1.Path

B. 在Dirl中的Change事件中,输入File1.Path=Dir1.Path

C. 在File1中的Change事件中,输入Dir1.Path=File1.Path

D. 在Dir1中的Change事件中,输入Dir1.Path=File1.Path

17. 在窗体上画一个通用对话框图,其Name属性为Cont,瑞画一个命令按钮,Name属性为

Command1,然后编写如下事件过程: Privute Sub Command1_Click( )

Cont.FileName=" " Cont.Flags=vbOFNFileMustExist Cont.Filter="All Files|

* . *" Cont.FilterIndes_3 Cont.DialogTitle="Open File"

Cont.Action=1 If Cont.FileName=" " Then MsgBox "No file selected"

Else Open Cont.FileName For Input As #1 Do While Not EOF(1)

Input #1. b$ Print b$ Loop End If End

Sub 以下各选项,对上述事件过程描述错误的是( )。

A. ++i; B. D--;

C. c++; D. --f;

18. 下面的程序的运行结果是( )。 a=1 b=1 Do a=a^2 b= b

+ 1 Loop Until b>5 Print "k=";a;Spc(4);"b=";b + a

A. Computer B. 什么都没有

C. * * * * * * * * D. 程序出错

19. 可以在常量的后面加上类型说明符以显示常量的类型,可以表示整型常量的是( )。

A. % B. #

C. ! D. $

20. 要获得当前驱动器应使用驱动器列表框的属性是( )。

A. Path B. Drive

C. Dir D. Pattern

21. 下面语句正确的是( )。

A. If x<3 * y And x>y Then y=x^3

B. If x<3 * y And x>y Then y=3x

C. If x<3 * y:x>y Then y=x^3

D. If x<3 * y And x>y Then y=x * * 3

22. 声明一个变量为局部变量应该用( )。

A. Global B. Private

C. Static D. Public

23. 如果在窗体上添加一个通用对话框控件DBT,那么语句“DBT.Action=4”的作用是( )。

A. 编译器是检查程序错误的第一道防线

B. 源程序编译过程中没有出现任何错误,执行时就不会发生错误

C. Java的异常处理机制是检查程序错误的第二道防线

D. 选项A) 和C) 正确

24. 设执行以下程序段时依次输入2,4,6,执行结果为( )。 Dim a(4)As Integer

Dim b(4)AS Integer For k=0 To 2 a(k+1)=Val(InputBox("Enter data:"))


本文标签: 错误 过程 属性 执行 运算符