【计算机类职业资格】江苏计算机等级考试二级Visual+BASIC上机真题2012年3月及答案解析.doc

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

1、江苏计算机等级考试二级 Visual+BASIC 上机真题 2012 年 3 月及答案解析(总分:40.00,做题时间:70 分钟)一、考试说明:(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是在六位正整数中查找超级自恋数。如果将一个六位正整数从高位到低位,每两位分为一组,共分为三组,三组数据的立方的和正好等于其本身,则称该六位正整数为超级自恋数。 1 Option Explicit 2 Private Sub CmdFind_Click() 3 Dim k As Long,num()As Integer,fg As Boolean 4 Dim i As Inte

2、ger,st As String 5 st=“ 6 For k=100000 To 999999 7 fg=False 8 Call judge(k,num,fg) 9 If fg Then 10 For i=UBound(num) To 1 Step -1 11 st=st 按“清除“按钮,将两个文本框与列表框清空,焦点置于文本框“A:“上。 3.程序中至少应定义一个通用过程,用于求一个整数各位数字之和或判断一个整数是否是素数(注意:1 不是素数)。 【要求】 将窗体文件和工程文件分别命名为 F2 和 P2,并保存到 T 盘的根目录下。(分数:26.00)_江苏计算机等级考试二级 Visua

3、l+BASIC 上机真题 2012 年 3 月答案解析(总分:40.00,做题时间:70 分钟)一、考试说明:(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是在六位正整数中查找超级自恋数。如果将一个六位正整数从高位到低位,每两位分为一组,共分为三组,三组数据的立方的和正好等于其本身,则称该六位正整数为超级自恋数。 1 Option Explicit 2 Private Sub CmdFind_Click() 3 Dim k As Long,num()As Integer,fg As Boolean 4 Dim i As Integer,st As String 5

4、 st=“ 6 For k=100000 To 999999 7 fg=False 8 Call judge(k,num,fg) 9 If fg Then 10 For i=UBound(num) To 1 Step -1 11 st=st 按“清除“按钮,将两个文本框与列表框清空,焦点置于文本框“A:“上。 3.程序中至少应定义一个通用过程,用于求一个整数各位数字之和或判断一个整数是否是素数(注意:1 不是素数)。 【要求】 将窗体文件和工程文件分别命名为 F2 和 P2,并保存到 T 盘的根目录下。(分数:26.00)_正确答案:( Option Explicit Private Sub

5、CmdFind_Click() Dim a As Integer,b As Integer,ss As Long Dim n As Integer,st As String,k As Integer a=Text1: b=Text2 For n=a To b ss=n*n st=“ k=nsum(ss,st) If prime(k) Then List1.AddItem n & “2=“ & ss & “:“ & st & “=“ & k End If Next n End Sub Private Function nsum(n As Long,st As String) As Integer

6、 Dim p As String,q As String,i As Integer p=CStr(n) For i=1 To Len(P) q=Mid(p,i,1) nsum=nsum+Val(q) st=st & q & “+“ Next i st=Left(st,Len(st)-1) End Function Private Function prime(n As Integer)As Boolean Dim i As Integer If n=1 Then Exit Function For i=2 To Sqr(n) If n Mod i=0 Then Exit Function Next i prime=True End Function Private Sub CmdClear_Click() Text1=“ : Text2=“ List1.Clear Text1.SetFocus End Sub)解析:

展开阅读全文
相关资源
猜你喜欢
  • ISO TR 19201-2013 Mechanical vibration - Methodology for selecting appropriate machinery vibration standards《机械振动 选择适当机械振动标准的方法体系》.pdf ISO TR 19201-2013 Mechanical vibration - Methodology for selecting appropriate machinery vibration standards《机械振动 选择适当机械振动标准的方法体系》.pdf
  • ISO TR 19234-2016 Hydrometry - Low cost baffle solution to aid fish passage at triangular profile weirs that conform to ISO 4360《水文测量 符合ISO 4360的三角断面溢流堰上鱼类通道低成本.pdf ISO TR 19234-2016 Hydrometry - Low cost baffle solution to aid fish passage at triangular profile weirs that conform to ISO 4360《水文测量 符合ISO 4360的三角断面溢流堰上鱼类通道低成本.pdf
  • ISO TR 19319-2013 Surface chemical analysis - Fundamental approaches to determination of lateral resolution and sharpness in beam-based methods《表面化学分析 基于光束方法中横向.pdf ISO TR 19319-2013 Surface chemical analysis - Fundamental approaches to determination of lateral resolution and sharpness in beam-based methods《表面化学分析 基于光束方法中横向.pdf
  • ISO TR 19358-2002 Ergonomics - Construction and application of tests for speech technology《人类工效学 语音技术试验的建立和应用》.pdf ISO TR 19358-2002 Ergonomics - Construction and application of tests for speech technology《人类工效学 语音技术试验的建立和应用》.pdf
  • ISO TR 19480-2005 Polyethylene pipes and fittings for the supply of gaseous fuels or water - Training and assessment of fusion operators《气态燃料或水供应用聚乙烯管和配件 熔焊操作者的.pdf ISO TR 19480-2005 Polyethylene pipes and fittings for the supply of gaseous fuels or water - Training and assessment of fusion operators《气态燃料或水供应用聚乙烯管和配件 熔焊操作者的.pdf
  • ISO TR 19601-2017 Nanotechnologies - Aerosol generation for air exposure studies of nano-objects and their aggregates and agglomerates (NOAA)《纳米技术 纳米物质及其凝聚体和团聚体.pdf ISO TR 19601-2017 Nanotechnologies - Aerosol generation for air exposure studies of nano-objects and their aggregates and agglomerates (NOAA)《纳米技术 纳米物质及其凝聚体和团聚体.pdf
  • ISO TR 19664-2017 Human response to vibration - Guidance and terminology for instrumentation and equipment for the assessment of daily vibration exposure at the.pdf ISO TR 19664-2017 Human response to vibration - Guidance and terminology for instrumentation and equipment for the assessment of daily vibration exposure at the.pdf
  • ISO TR 19811-2017 Gas cylinders - Service life testing for cylinders and tubes of composite construction《气瓶 复合结构气瓶和管件的使用寿命试验》.pdf ISO TR 19811-2017 Gas cylinders - Service life testing for cylinders and tubes of composite construction《气瓶 复合结构气瓶和管件的使用寿命试验》.pdf
  • ISO TR 19905-2-2012 Petroleum and natural gas industries - Site-specific assessment of mobile offshore units - Part 2 Jack-ups commentary and detailed sample ca.pdf ISO TR 19905-2-2012 Petroleum and natural gas industries - Site-specific assessment of mobile offshore units - Part 2 Jack-ups commentary and detailed sample ca.pdf
  • 相关搜索

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

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