【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年春季及答案解析.doc

上传人:Iclinic170 文档编号:1335926 上传时间:2019-10-17 格式:DOC 页数:2 大小:28KB
下载 相关 举报
【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年春季及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】江苏计算机二级考试+Visual+Basic上机真题一2013年春季及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、江苏计算机二级考试+Visual+Basic 上机真题一 2013 年春季及答案解析(总分:2.00,做题时间:70 分钟)1.改错题 【题目】 本程序的功能是找出给定范围内因子个数最多的整数.程序界面参加下图 (本程序界面由 1 个 ListBox、1 个 Label、1 个 TextBox 和 1 个 CommandButton 组成,所有对象均采用缺省名) Option Explicit Option Base 1 Private Sub Command1_Click() Dim i As integer,j as integer,m as integer,n as integer Di

2、m s As String, mx as integer Dim yz() as integer,c() as integer m=15: n=35 Redim c(m:n) For i=m to n s=i & “:“ Call qyz(i,yz) c(i)=Ubound(yz) For j=1 to Ubound(yz) s=s & yz(j) &“,“ next j s=Left(s,len(s)-1) List1.Additem s Next i mx=c(1) For i=m to n if c(i)mx then mx=c(i) Next i For i=m to n if c(i

3、)=mx then Text1.text=text1.text & i & “,“ Next i Text1.Text=Left(Text1.text,Len(text1.text)-1) End Sub Private Sub qyz(Byval n as integer,yz() as integer) Dim i as integer,p as integer For i=1 to n-1 if n mod i=0 then p=p+1 Redim yz(p) yz(p)=i End if next i End Sub 1.新建工程,按参考界面形式创建窗体,再从 T 盘根目录下的 err

4、txt 文件中将有错误的程序代码复制到代码编辑器窗口中或自行输入上述代码,改正程序中的错误。 2.改错时,不得增加或删除语句,但可适当调整语句的位置。 3.将窗体文件和工程文件分别命名为 F1 和 P1,并保存到 T 盘的根目录下。(分数:1.00)_2.编程题 【题目】 编写程序,输入一个对称数,求比该对称数大的最近的一个对称数,所以对称数是指正读与倒读都相同的整数,例如 12321 就是一个对称数 【编程要求】 1.程序界面参见下图,编程时不得增加或减少界面对象或改变对象的种类,窗体及界面元素大小适中,且均可见 2.运行程序,在“对称数 n:”文本框中输入一个整数,按”运行”按钮,判断输

5、入的数是否为对称数,如果是,则计算机下一个对称数,并显示结果,否则,显示如图所示(分数:1.00)_江苏计算机二级考试+Visual+Basic 上机真题一 2013 年春季答案解析(总分:2.00,做题时间:70 分钟)1.改错题 【题目】 本程序的功能是找出给定范围内因子个数最多的整数.程序界面参加下图 (本程序界面由 1 个 ListBox、1 个 Label、1 个 TextBox 和 1 个 CommandButton 组成,所有对象均采用缺省名) Option Explicit Option Base 1 Private Sub Command1_Click() Dim i As

6、integer,j as integer,m as integer,n as integer Dim s As String, mx as integer Dim yz() as integer,c() as integer m=15: n=35 Redim c(m:n) For i=m to n s=i & “:“ Call qyz(i,yz) c(i)=Ubound(yz) For j=1 to Ubound(yz) s=s & yz(j) &“,“ next j s=Left(s,len(s)-1) List1.Additem s Next i mx=c(1) For i=m to n

7、if c(i)mx then mx=c(i) Next i For i=m to n if c(i)=mx then Text1.text=text1.text & i & “,“ Next i Text1.Text=Left(Text1.text,Len(text1.text)-1) End Sub Private Sub qyz(Byval n as integer,yz() as integer) Dim i as integer,p as integer For i=1 to n-1 if n mod i=0 then p=p+1 Redim yz(p) yz(p)=i End if

8、next i End Sub 1.新建工程,按参考界面形式创建窗体,再从 T 盘根目录下的 err.txt 文件中将有错误的程序代码复制到代码编辑器窗口中或自行输入上述代码,改正程序中的错误。 2.改错时,不得增加或删除语句,但可适当调整语句的位置。 3.将窗体文件和工程文件分别命名为 F1 和 P1,并保存到 T 盘的根目录下。(分数:1.00)_正确答案:()解析:2.编程题 【题目】 编写程序,输入一个对称数,求比该对称数大的最近的一个对称数,所以对称数是指正读与倒读都相同的整数,例如 12321 就是一个对称数 【编程要求】 1.程序界面参见下图,编程时不得增加或减少界面对象或改变对象的种类,窗体及界面元素大小适中,且均可见 2.运行程序,在“对称数 n:”文本框中输入一个整数,按”运行”按钮,判断输入的数是否为对称数,如果是,则计算机下一个对称数,并显示结果,否则,显示如图所示(分数:1.00)_正确答案:()解析:

展开阅读全文
相关资源
猜你喜欢
  • BS EN ISO 3815-2-2005 Zinc and zinc alloys - Analysis by inductively coupled plasma optical emission spectrometry《锌和锌合金 用感应耦合等离子体光发射光谱测定法分析》.pdf BS EN ISO 3815-2-2005 Zinc and zinc alloys - Analysis by inductively coupled plasma optical emission spectrometry《锌和锌合金 用感应耦合等离子体光发射光谱测定法分析》.pdf
  • BS EN ISO 3821-2010 Gas welding equipment - Rubber hoses for welding cutting and allied processes《气焊设备 焊接,切割和相关工艺用橡胶软管》.pdf BS EN ISO 3821-2010 Gas welding equipment - Rubber hoses for welding cutting and allied processes《气焊设备 焊接,切割和相关工艺用橡胶软管》.pdf
  • BS EN ISO 3822-2-1996 Acoustics Laboratory tests on noise emission from appliances and equipment used in water supply installations Mounting and operating conditions for draw-off t.pdf BS EN ISO 3822-2-1996 Acoustics Laboratory tests on noise emission from appliances and equipment used in water supply installations Mounting and operating conditions for draw-off t.pdf
  • BS EN ISO 3822-4-1997 Acoustics Laboratory tests on noise emission from appliances and equipment used in water supply installations Mounting and operating conditions for special ap.pdf BS EN ISO 3822-4-1997 Acoustics Laboratory tests on noise emission from appliances and equipment used in water supply installations Mounting and operating conditions for special ap.pdf
  • BS EN ISO 3823-1-1999 Dental rotary instruments - Burs - Steel and carbide burs《牙科用旋转器械 牙钻 钢制牙钻和硬质合金牙钻》.pdf BS EN ISO 3823-1-1999 Dental rotary instruments - Burs - Steel and carbide burs《牙科用旋转器械 牙钻 钢制牙钻和硬质合金牙钻》.pdf
  • BS EN ISO 3826-1-2013 Plastics collapsible containers for human blood and blood components Conventional containers《人类血液及血液成分用塑料可折叠容器 常规容器》.pdf BS EN ISO 3826-1-2013 Plastics collapsible containers for human blood and blood components Conventional containers《人类血液及血液成分用塑料可折叠容器 常规容器》.pdf
  • BS EN ISO 3826-2-2008 Plastics collapsible containers for human blood and blood ncomponents - Part 2 Graphical symbols for use on labels and ninstruction leaflets《人类血液及血液成分用塑料可折叠容器.pdf BS EN ISO 3826-2-2008 Plastics collapsible containers for human blood and blood ncomponents - Part 2 Graphical symbols for use on labels and ninstruction leaflets《人类血液及血液成分用塑料可折叠容器.pdf
  • BS EN ISO 3826-4-2015 Plastics collapsible containers for human blood and blood components Aphaeresis blood bag systems with integrated features《人类血液和血液成分用塑料可折叠容器 具有整合特点的机采血袋系统》.pdf BS EN ISO 3826-4-2015 Plastics collapsible containers for human blood and blood components Aphaeresis blood bag systems with integrated features《人类血液和血液成分用塑料可折叠容器 具有整合特点的机采血袋系统》.pdf
  • BS EN ISO 3834-1-2005 Quality requirements for fusion welding of metallic materials - Criteria for the selection of the appropriate level of quality requirements《金属材料熔焊的质量要求 质量要求的适.pdf BS EN ISO 3834-1-2005 Quality requirements for fusion welding of metallic materials - Criteria for the selection of the appropriate level of quality requirements《金属材料熔焊的质量要求 质量要求的适.pdf
  • 相关搜索

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

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