版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1 2006 年秋试题 1(每小题3 分,共 12 分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】? 运行时初始界面如左上图所示,在文本框中输入一个整数n 并按回车键后:如果n1则重新输入,否则按钮command1 可用;? 按 command1 计算费波那契数列第n 项的值(该数列第1、 2 项均为 1,此后各项为该项前两项之和,如:1、1、2、3、5、8、) ;? 用消息框输出结果(右上图表示输入n 为 8 后,输出结果是21) ,按消息框中“是”按钮则界面显示如左上图,按“否”按钮则退出。【程序】dim n as integer private
2、sub form_load() command1.enabled = false end sub private sub text1_keypress(k as integer) if (1) then exit sub n = text1.text if n 1 then msgbox (n应大于零! ): exit sub command1.enabled = true end sub private sub command1_click() dim i as integer (2) f(1) = 1: f(2) = 1 for i = (3) f(i) = f(i-1) + f(i-2)
3、 next i k = msgbox(第 & n & 项为 & f(n) & ,是否继续?, (4) ) if k = vbyes then text1.text = : command1.enabled = false text1.setfocus else 2 end end if end sub 【供选择的答案】(1) a 、k = 13b、 k 13 c、keyascii 13d、keyascii=13 (2) a 、redim f(8) as long b 、redim f(n) as long c、dim f(n) as long d 、dim f(
4、8) as long(3) a 、1 to nb、 1 to n step 1 c、2 to nd、3 to n(4) a 、vbnob、 vbyes c 、vbyesnod、vbquestion 试题 2(每小题3 分,共 15 分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】单击 command1 后,将所有在list1中存在、而在list2中不存在的表项添加到列表框控件 list3中。private sub command1_click() dim i as integer, j as integer (5) for i = 0 to (6) fo
5、r j = 0 to (7) if list1.list(i) = list2.list(j) then (8) next j if (9) then list3.additem list1.list(i) next i end sub 【供选择的答案】(5) a 、list3.clear b、list3.list= c、list3.delete d、list3.cls (6) a 、list1.listcount b、list1.listcount - 1 c、list2.listcount d、list2.listcount - 1 (7) a 、list2.listcount - 1 b
6、、list2.listcount c、list1.listcount 1 d、list1.listcount (8) a 、exit for b、exit c、exit do d、break (9) a 、j list2.listcount b、j list2.listcount d、j= list2.listcount 试题 3(每小题3 分,共 15 分)阅读下列程序说明和程序,在每小题提供的若干可选答案中,挑选一个正确答案。【程序说明】选择一个图象文件(bmp 、jpg )后,在图片框控件p1 中显示,按“反转”按钮后,将p1 中每一像素在p2中相应位置以不同颜色显示。3 【程序】pri
7、vate sub form_load() file1. (10) = *.bmp;*.jpg p2.width = p1.width: p2.height = p1.height p1.scalemode = 3: p2.scalemode = 3 end sub private sub dir1_change() file1.path = dir1.path end sub private sub drive1_change() dir1.path = (11) end sub private sub file1_click() (12) goto kk p1.picture = loadp
8、icture(file1.path + file1.filename) exit sub kk: p1.picture = loadpicture(file1.path + + file1.filename) end sub private sub command1_click() dim x as integer, y as integer, (13) dim r as byte, g as byte, b as byte for x = p1.scaleleft to p1.scaleleft + p1.scalewidth for y = p1.scaletop to p1.scalet
9、op + p1.scaleheight c = p1.point(x, y) if c = 0 then r = c mod 256: c = c 256 g = c mod 256: c = c 256 4 (14) p2.pset (x, y), rgb(255 - r, 255 - g, 255 - b) end if next y, x end sub 【供选择的答案】(10) a 、filter b、pattern c、 filename d、path (11) a 、dir1.path b、file1.path c、 drive1.path d、drive1.drive (12)
10、a 、on error b、in error c、 if error d、if error then (13) a 、c as byte b、c as long c、 c as single d、c as integer (14) a 、b = c mod 255 b、b = c 256 c、 b = c d、b = c / 256 试题 4(每小题3 分,共 9 分)阅读下列程序并回答问题,在每小题提供的若干可选答案中,挑选一个正确答案。【程序】private sub form_click() dim n as integer, i as integer, k as integer, j a
11、s integer do n = inputbox(请输入 1 个 1 至 9 之间的整数 ) loop until 0 n and n 10 k = 10: j = 1 for i = 1 to n print space(k); string(j, trim(str(i) if i 80 then timer1.enabled = false end sub (18) 程序运行后,事件过程timer1_timer自动执行的次数为: a 、9 b、 10 c、11 d、0 (19) “运行中 .”这段文字的显示位置始终在窗体的 a 、窗体的左边 b、label1 的右边 c、窗体的右边 d、
12、label1 的中间(20) label1的标题在窗体上的显示多次变化,其规律为: a 、字体变大、变化减慢b、字体变小、变化减慢 c 、字体变小、变化加快d、字体变大、变化加快试题 6(每小题3 分,共 12 分)阅读下列程序并回答问题,在每小题提供的若干可选答案中,挑选一个正确答案。【程序】 private sub form_load() form1.height = form1.width * 2 / 3 form1.fillcolor = rgb(0, 0, 255) form1.fillstyle = vbsolid end sub private sub form_activate
13、() scale (0, 0)-(300, 200) paint.caption = circle line -(150, 100), fillcolor, bf end sub 6 private sub paint_click() form1.cls if paint.caption = circle then paint.caption = rectanfle circle (scalewidth / 2, scaleheight / 2), scaleheight / 2, _ 255, , , scaleheight / scalewidth else paint.caption =
14、 circle line -(150, 100), fillcolor, bf end if end sub (21) 菜单项标题为“circle” 、名称为“ paint ” ,单击该菜单项后窗体上显示: a 、圆b、纵轴大于横轴的椭圆c、横轴大于纵轴的椭圆d、 矩形(22) 菜单项标题为“rectanfle” 、名称为“ paint ” ,单击该菜单项后所显示图形: a 、红色边框无填充色的椭圆b、兰色边框黑色填充的矩形 c 、黑色边框兰色填充的椭圆d、兰色边框兰色填充的矩形(23) 菜单项标题为“circle” ,两次单击名称为“paint ”的该菜单项,窗体显示: a 、椭圆b、矩形c
15、 、1 个椭圆和1 个矩形d、1 个椭圆和1 个正方形(24) 菜单项标题为“rectanfle” ,两次单击名称为“paint ”的该菜单项,窗体显示: a 、椭圆b、矩形c 、1 个椭圆和1 个矩形d、1 个椭圆和1 个正方形试题 7(14 分)编写事件过程command1_click,计算下式的和,变量x 与 n 的数值用输入对话框输入。试题 8(14 分)某文本文件以下列格式存储若干学生的学号和两门课成绩,编写单击窗体的事件过程: 用通用对话框控件commondialog1 选择该文件; 在 label1(0)label1(1) 显示总分最高的学生之学号、总分。)!1(.!4!3!23
16、2nxxxxsn文本文件格式05010101,78,89 05010102,83,79 . 7 试题 16( 每小题 3 分 ) b b d c a b a a d b d a b c b d b c a a (21)c (22)d (23)b (24) a 试题 7 ( 每题 14 分) private sub command1_click() dim s as single, x as single, t as single dim i as integer, n as integer x = inputbox(x=) n = inputbox(n=) s = x / 2: t = x / 2 for i = 3 to n + 1 t = t * x / i s = s + t next i print s end sub试题 8 ( 每题 14 分)private sub form_click() dim xh as string, zf as integer dim x as string, k1 as integer, k2 as integer commondialog1.showopen open commondialog1.filename for input as #1 do while not eof(1) input #1,x,k1,k2 if k1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- MT/T 1314-2025煤矿在用无极绳连续牵引车检测检验规范
- 放疗生物练习题及答案分享
- TBFIA 048-2025 分布式数据库技术金融应用 数据迁移要求
- 省考联考·行政职业能力测验押题卷(真题汇编)
- 2025数学一历年真题(详细解析)
- 交通运输的历史与发展
- 全国统考数学二冲刺试卷|2025考研(提分冲刺卷)
- 急性腮腺炎的抢救流程
- CorelDRAW 设计案例试题及答案
- 《执业药师职业资格制度规定》解读
- 2026新教材语文 4《冀中地道战》第一课时 教学课件
- 2026秋人教版初中英语七年级上册(新教材)教学计划含进度表
- 喷砂工考试题及答案
- 《石材加工企业职业病危害风险分级管控体系实施指南》
- 2026重庆科瑞南海制药有限责任公司招聘15人笔试备考题库及答案详解
- 2026年秋季学期小学三年级信息科技教学计划(人教版2024上册)
- 5.1《从小爱劳动》课件 统编版道德与法治三年级下册
- 人手及物体初始菌检验方法的验证21
- 九年级生命生态安全教案(完整版)
- 竞选大学心理委员ppt模板
- 矿山供电技术ch1.1矿山供电系统课件
评论
0/150
提交评论