【计算机类职业资格】数据文件及答案解析.doc
《【计算机类职业资格】数据文件及答案解析.doc》由会员分享,可在线阅读,更多相关《【计算机类职业资格】数据文件及答案解析.doc(5页珍藏版)》请在麦多课文档分享上搜索。
1、数据文件及答案解析(总分:32.00,做题时间:90 分钟)一、B选择题/B(总题数:10,分数:20.00)1.在用 Open 语句打开文件时,如果省略了“For 方式”,则打开文件的存取方式是 _ 。(分数:2.00)A.顺序输入方式B.随机存取方式C.二进制方式D.顺序存取方式2.当发生 Form_ Click 事件后,下面这段程序代码的执行结果为在窗体中输出_ 。 Option Explicit Private Sub Form Click () Dim num As String * 1, n As Integer Open “C:/ Check. txt“ For Random A
2、s #10 For n = 1 To 6 num = Chr(n + 64) Put %10, n, num Next n Seek #10, 3: Get #10, , num Print Loc(10); Seek(10) End Sub(分数:2.00)A.3 4B.4 5C.5 3D.3 33.在窗体上画一个名称为 CommonDialog1的通用对话框和一个名为 Command1的命令按钮。要求实现这样一个功能:单击命令按钮后,打开一个通用对话框用于保存文件,其窗口标题为“保存”,默认文件名为Data,在“文件类型”栏中显示*.txt。下列程序中能实现以上功能的是_ 。(分数:2.0
3、0)A.Private Sub Command1_ Click() CommonDialog1. FileName = “Data“ CommonDialog1. Filter = “All Files*.* (*.tx(*.do*.doc“ CommonDialog1. Filterlndex = 2 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End SubB.Private Sub Command1_ Click() CommonDialog1. FileName = “Data“ CommonDialog1.
4、Filter = “All Files*.*(*.tx(*.do*.doc“ CommonDialog1. FilterIndex = 2 CommonDialog1. DialogTitle =“保存” CommonDialog1. Action = 1 End SubC.Private Sub Command1_ Click() CommonDialog1. FileName = “Data“ CommonDialog1. Filter = “All Files*.*(*.tx(*.do*.doc“ CommonDialog1. FilterIndex = 1 CommonDialog1.
5、 DialogTitle = “保存” CommonDialog1. Action = 1 End SubD.Private Sub Command1_ Click() CommonDialog1. FileName = “Data“ CommonDialog1. Filter = “All Files*.*(*.tx(*.do*.doc“ CommonDialog1. FilterIndex = 1 CommonDialog1. DialogTitle = “保存” CommonDialog1. Action = 2 End Sub4.要向 Data.dat 文件中添加数据,下面语句中正确的
6、是_ 。(分数:2.00)A.Open “Datdat“ For OutputAs #1B.Open “Datdaf For InputAs #1C.Open Datdat For OutputAs #ID.Open Datdar For Append As #15.用来设置文件中下一个读写位置的语句是_ 。(分数:2.00)A.SkipB.SeekC.FileAttrD.Select6.下列文件函数中,作用为以整数形式返回 Open 语句可以使用的下一个有效的文件号的是_ 。(分数:2.00)A.LofB.FileAttrC.FreeFileD.FileLen7.判断是否到达文件尾和返回文件
7、字节数的函数是_ 。(分数:2.00)A.EOF ENDB.END CLOSEC.EOF LOFD.END LOF8.下列语句中_ 是顺序文件操作和随机文件操作中都有的。(分数:2.00)A.PrintB.GetC.PutD.Close9.以下叙述中不正确的是_ 。(分数:2.00)A.顺序文件结构简单B.存储在顺序存取文件中的记录不允许任意存取C.能同时对顺序文件进行读写操作D.顺序文件的数据以字符(ASCII 码的形式存储)10.要在 D盘的 Temp 目录下建立一个名为 Name.dat 的顺序文件,应使用_ 语句。(分数:2.00)A.Open “Nam dat“ For Output
8、 As #1B.Open “Nam dat“ For Input As #1C.Open “D:/Temp/Namdat“ For InputAs #1D.Open “D:/Temp/Namdat“ For Output As #1二、B填空题/B(总题数:6,分数:12.00)11.下列程序段的功能为:单击窗体后,在 D盘 Temp目录下 address.txt 文件中输入“张三,20,Male”。请填空。 Private Sub form_ click() Dim name As String Dim age As Integer Dim sex As String name = “张三“
9、: age = 20: sex = “Male“ Open “D:/temp/Code.txt“ For Append As #1 _ #1, name, age, sex _ End Sub(分数:2.00)填空项 1:_12.驱动器列表框控件最重要的属性为 Drive 属性。该属性用于设置或者返回所选择的驱动器名。Drive 属性只能用 1 设置,不能通过属性窗口来设置。(分数:2.00)填空项 1:_13. 1 属性用于设置文件列表框中显示的文件类型,它可以在设计阶段用属性窗口设置,也可以通过程序代码设置。(分数:2.00)填空项 1:_14.下面一段程序的功能是,单击命令按钮后将 D盘
10、 temp 目录下的 staff.txt 文件内容读出,并在文本框 Text1中显示出来。请填空。 Private Sub Command1_ Click() Dim Line As String, FileNo As Integer Dim People As String FileNo = FreeFile Open “D:/temp/staff.txt“ For Input As _ DO While Not _ Line Input #FileNo, Line People = People + Line + Chr(13) + Chr(10) Loop Text1.Text = Pe
11、ople End Sub(分数:2.00)填空项 1:_15.下面一段程序的功能是,单击窗体弹出对话框。在对话框中输入一个文件名,窗体中输出该文件名的文件号。请填空。 Private Sub Form_ click() filename = InputSox (“请输入文件名”) Filecode = Open filename For Output As # Filecode Print filename; “的文件号是”; Filecode Close # Filecode End Sub(分数:2.00)填空项 1:_16.在许多应用程序中,都需要对文件进行操作,显示关于磁盘驱动器、目录
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
5000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 职业资格 数据文件 答案 解析 DOC
