[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc

上传人:孙刚 文档编号:504197 上传时间:2018-11-29 格式:DOC 页数:28 大小:219KB
下载 相关 举报
[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc_第1页
第1页 / 共28页
[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc_第2页
第2页 / 共28页
[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc_第3页
第3页 / 共28页
[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc_第4页
第4页 / 共28页
[计算机类试卷]国家二级(VB)机试模拟试卷59及答案与解析.doc_第5页
第5页 / 共28页
点击查看更多>>
资源描述

1、国家二级( VB)机试模拟试卷 59及答案与解析 一、选择题 1 要使标签中的文本靠右显示,应将其 Aligment属性设置为 ( A) 0-Left Justify ( B) 1-Right Justify ( C) 2-Center ( D) 3 2 为了删除列表框中的一个列表项,应使用的列表框方法是 ( A) Move ( B) Remove ( C) Clear ( D) RemoveItem 3 通过一个属性可以获得文件列表框中当前被选中文件的文件名,这个属性是 ( A) Dir ( B) Path ( C) Drive ( D) FileName 4 在设计阶段,假定在图片框 Pi

2、cture1中装入了一个图形,为了删除该图片框控件,应采用的正确操作是 ( A)选择图片框,然后按 Del键 ( B)执行语句 Picture1.Picture = LoadPicture(“) ( C)执行语句 Picture1.Picture = “ ( D)选择图片框,在属性窗口中选择 Picture属性,然后按回车键 5 以下不能用形状控件画出的图形是 ( A)矩形 ( B)圆形 ( C)椭圆 ( D)扇形 6 为了暂 时关闭计时器,应把它的一个属性设置为 False,这个属性是 ( A) Visible ( B) Timer ( C) Enabled ( D) Interval 7

3、假定在窗体上添加了一个通用对话框控件,其名称为 CD1,并有如下程序段: CD1. ShowOpen CD1.DefaultExt = “doc“ 在打开文件的对话框中选择了 “c:file1.txt“文件,则 FileTitle属性的值是 ( A) file1.doc ( B) file1.txt ( C) c:file1.txt ( D) c:file1.doc 8 以下能接收焦点的控件是 ( A)图像框 ( B)框架 ( C)命令按钮 ( D)标签 9 以下不能设置 Picture属性的控件是 ( A)窗体 ( B)列表框 ( C)复选框 ( D)命令按钮 10 假定有如下程序: Pri

4、vate Sub Form_Click() Dim N As Integer, J As Integer N = 0 J = 1 Do Until N 2 N = N + 1 J = J + N * (N + 1) Loop Print N; J End Sub 运行程序,单击窗体,输出结果是 ( A) 3 21 ( B) 3 7 ( C) 0 1 ( D) 3 13 11 在窗体上画一个组合框,其名称为 Combo1,然后编写如下事件过程: Private Sub Form_Load() Combo1.Text = “1“ For i = 1 To 10 Sum = Sum + i Next

5、 i Combo1.Text = Sum End Sub 程序运行后,输出结果为 ( A)在组合框的编辑区中显示 1 ( B)在组合框的编辑区中显示不定值 ( C)在组合框的编辑区中显示 55 ( D)出错信息 12 假定有如下程序: Private Sub Form_Click() Dim a(4) As Integer, b(4) As Integer For k = 0 To 2 a(k + 1) = Val(InputBox(“请输入一个整数: “) b(3 - k) = a(k + 1) Next k Print b(k) End Sub 运行程序,单击窗体,依次输入 3、 6、 9

6、,输出结果为 ( A) 3 ( B) 6 ( C) 9 ( D) 1 13 设窗体上有一个 Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Static x As Integer x = x + 1 Call proc(x) Print x, End Sub Private Sub proc(a As Integer) Static x As Integer x = x + a a = x End Sub 程序运行后, 3次单击命令按钮,则产生的输出是 ( A) 1 2 3 ( B) 1 3 5 ( C) 1 3 7 ( D) 2 4 6

7、 14 设有如下程序: Private Sub sV(ByVal m As Integer, n As Integer) m = m * 2 n = n - 5 Print m; n End Sub Private Sub Form_Click() Dim x As Integer, y As Integer x = 10 y = 15 sV x, y Print x; y End Sub 运行程序,单击窗体,输出结果为 ( A) 20 10 10 10 ( B) 10 15 20 10 ( C) 20 15 10 15 ( D) 20 10 20 10 15 阅读程序: Option Bas

8、e 1 Private Sub Form_Click() Dim a(3, 3) As Integer For i = 1 To 3 For j = 1 To 3 a(i, j) = _ Print a(i, j); Next j Print Next i End Sub 运行上面的程序,单击窗体,输出结果如 下: 1 4 7 2 5 8 3 6 9 则在横线处应填入的内容为 ( A) i + j ( B) i * j ( C) (i -1) * 3 + j ( D) i + (j - 1) * 3 16 有如下程序: Private Sub Form_Click() Dim S As Str

9、ing S = InputBox(“请输入一个字符串: “) For i = 1 To Len(S) 2 If Mid(S, i, 1) Max或 Max arrN(i) 步骤 3:调试并运行程序,关闭程序后按题目要求存盘。 (2)【操作步骤】 步骤 1:打开本题工程文件。 步骤 2:分析并编写程序代码。 参考答案 Function Fun() Dim s As Integer, i As Integer For i = 1 To 1000 If i Mod 5 = 0 Or i Mod 7 = 0 Then s = s + 1 End If Next i Fun = s End Functi

10、on 步骤 3:调试并运行程序,关闭程序后按题目要求存盘。 四、综合应用题 43 【正确答案】 【操作步骤】 步骤 1:打开本题工程文件,添加一个标题为 “各行最小数的平均值为 “的标签Label2,再添加一个初始内容为空的文本框 Text2。 步骤 2:分析并编写程序代码。 程序提供代码 Option Base 1 Dim a(20, 5) As Integer Private Sub Command1_Click() Open App.Path & “in5.dat“ For Input As #1 For i = 1 To 20 For j = 1 To 5 Input #1, a(i,

11、 j) Text1 = Text1 + Str(a(i, j) + Space(2) Next j Text1 = Text1 + Chr(13) + Chr(10) Next i Close #1 End Sub Private Sub Command2_Click() 考生编写 End Sub Private Sub Form_Unload(Cancel As Integer) Open App.Path & “out5.dat“ For Output As #1 Print #1, Text2.Text Close #1 End Sub 程序结束 参考答案 Private Sub Command2_Click() 考生编写 Dim sum As Long Dim min As Long Dim b(20) As Integer For i = 1 To 20 min = a(i, 1) For j = 1 To 5 If a(i, j) min Then min = a(i, j) End If Next j b(i) = min Next i sum = 0 For i = 1 To 20 sum = sum + b(i) Next Text2 = sum / 20 End Sub 步骤 3:调试并运行程序,关闭程序后按题目要求存盘。

展开阅读全文
相关资源
猜你喜欢
  • ASD-STAN PREN 6049-009-2013 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 009 Self-wrapping fire protection sleeve flexible post inst.pdf ASD-STAN PREN 6049-009-2013 Aerospace series Electrical cables installation Protection sleeve in meta-aramid fibres Part 009 Self-wrapping fire protection sleeve flexible post inst.pdf
  • ASD-STAN PREN 6050-2006 Aerospace Series Pins Close Tolerance Swage Locking 100 Degree Countersunk Head Reduced Shear Type in Aluminium Alloy 7050 Chemical Film Inch Series (Editio.pdf ASD-STAN PREN 6050-2006 Aerospace Series Pins Close Tolerance Swage Locking 100 Degree Countersunk Head Reduced Shear Type in Aluminium Alloy 7050 Chemical Film Inch Series (Editio.pdf
  • ASD-STAN PREN 6051-2006 Aerospace Series Collars Swage Locking Shear Type in Aluminium Alloy 3003 Chemical Film Inch Series (Edition P 3)《航空航天系列 英制系列带化学薄膜的铝合金3003制抗剪式模锻锁紧襟圈 第P3版.pdf ASD-STAN PREN 6051-2006 Aerospace Series Collars Swage Locking Shear Type in Aluminium Alloy 3003 Chemical Film Inch Series (Edition P 3)《航空航天系列 英制系列带化学薄膜的铝合金3003制抗剪式模锻锁紧襟圈 第P3版.pdf
  • ASD-STAN PREN 6052-1995 Aerospace Series Rivets - Collar - System in Aluminium Alloy Shear Type Inch Series Technical Specification (Edition P 1)《航空航天系列 英制系列铝合金制抗剪式铆钉-襟圈系统 技术规范 第P1.pdf ASD-STAN PREN 6052-1995 Aerospace Series Rivets - Collar - System in Aluminium Alloy Shear Type Inch Series Technical Specification (Edition P 1)《航空航天系列 英制系列铝合金制抗剪式铆钉-襟圈系统 技术规范 第P1.pdf
  • ASD-STAN PREN 6054-2007 Aerospace series Collars swage locking shear type in aluminium alloy 6061 chemical film Inch series (Edition P 4)《航空航天系列 英制系列带化学薄膜的铝合金6061制抗剪式模锻锁紧襟圈 第P4版.pdf ASD-STAN PREN 6054-2007 Aerospace series Collars swage locking shear type in aluminium alloy 6061 chemical film Inch series (Edition P 4)《航空航天系列 英制系列带化学薄膜的铝合金6061制抗剪式模锻锁紧襟圈 第P4版.pdf
  • ASD-STAN PREN 6055-2018 Aerospace series - Rod-end with bearing per EN 4265 in corrosion resisting steel external threaded shank - Dimensions and loads - Inch series (Edition P 2).pdf ASD-STAN PREN 6055-2018 Aerospace series - Rod-end with bearing per EN 4265 in corrosion resisting steel external threaded shank - Dimensions and loads - Inch series (Edition P 2).pdf
  • ASD-STAN PREN 6057-2007 Aerospace series Rod-ends with bearing per EN4265 in corrosion resisting steel internal threaded shank Dimensions and loads Inch series (Edition P 1)《航空航天系列.pdf ASD-STAN PREN 6057-2007 Aerospace series Rod-ends with bearing per EN4265 in corrosion resisting steel internal threaded shank Dimensions and loads Inch series (Edition P 1)《航空航天系列.pdf
  • ASD-STAN PREN 6059-100-2013 Aerospace series Electrical cables installation Protection sleeves Test methods Part 100 General (Edition P 4).pdf ASD-STAN PREN 6059-100-2013 Aerospace series Electrical cables installation Protection sleeves Test methods Part 100 General (Edition P 4).pdf
  • ASD-STAN PREN 6059-201-1997 Aerospace Series Electrical Cables Installation Protection Sleeves Test Methods Part 201 Visual Inspection (Edition P 1)《航空航天系列 电缆安装用防护套 试验方法 第201部分 目视检.pdf ASD-STAN PREN 6059-201-1997 Aerospace Series Electrical Cables Installation Protection Sleeves Test Methods Part 201 Visual Inspection (Edition P 1)《航空航天系列 电缆安装用防护套 试验方法 第201部分 目视检.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1