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

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

1、江苏计算机二级考试+Visual+Basic 上机真题一 2013 年秋季及答案解析(总分:40.00,做题时间:70 分钟)一、【考试须知】(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是生成由 n(n 通过 InputBox 函数输入)个 3 位升序数构成的随机数组,所谓升序数是指从高位到低位数字值依次增加的整数(本程序界面由 1 个 TextBox 和 1 个CommandButton 组成,所有对象均采用缺省名) (分数:14.00)_2.编程题(26 分) 【题目】 编写程序,找出给定范围内所有不是素数的亏数。所谓亏数是指除本身外其所有因子之和小于自身的

2、正整数。例如,106 的因子为 1、2、53,和为 56,故 106 是亏数。(注意:凡因子和为 1 的即为素数) (分数:26.00)_江苏计算机二级考试+Visual+Basic 上机真题一 2013 年秋季答案解析(总分:40.00,做题时间:70 分钟)一、【考试须知】(总题数:1,分数:0.00)1.改错题(14 分) 【题目】 本程序的功能是生成由 n(n 通过 InputBox 函数输入)个 3 位升序数构成的随机数组,所谓升序数是指从高位到低位数字值依次增加的整数(本程序界面由 1 个 TextBox 和 1 个CommandButton 组成,所有对象均采用缺省名) (分数:

3、14.00)_正确答案:(第 15 行 Loop Until kn 改为 k=n 第 17 行 Private Function judge(n as integer) As Boolean 改为 Byval n 第 24 行 If a(i)=a(i+1) Then Exit Function 改为 Exit Function)解析:2.编程题(26 分) 【题目】 编写程序,找出给定范围内所有不是素数的亏数。所谓亏数是指除本身外其所有因子之和小于自身的正整数。例如,106 的因子为 1、2、53,和为 56,故 106 是亏数。(注意:凡因子和为 1 的即为素数) (分数:26.00)_正确

4、答案:(Option Explicit Option Base 1 Private Sub CmdClear_Click() Text1.Text = “: Text2.Text = “ List1.Clear Text1.SetFocus End Sub Private Sub CmdFind_Click() Dim a As Integer, b As Integer, i As Integer Dim st As String, flg As Boolean, sum As Integer a = Val(Text1.Text) b = Val(Text2.Text) For i = a

5、 To b flg = False: st = “: sum = 0 Call judge(i, flg, st, sum) If flg Then List1.AddItem i & “:“ & st & “=“ & sum End If Next i If List1.ListCount = 9 Then List1.AddItem “指定范围内无亏数“ End Sub Private Sub judge(n As Integer, fg As Boolean, st As String, sum As Integer) Dim i As Integer For i = 1 To n - 1 If n Mod i = 0 Then sum = sum + i st = st & i & “+“ End If Next i If sum 1 Then fg = True st = Left(st, Len(st) - 1) End If End Sub)解析:

展开阅读全文
相关资源
猜你喜欢
  • ONORM EN 29997-1992 Dental cartridge syringes《牙科卡式注射器》.pdf ONORM EN 29997-1992 Dental cartridge syringes《牙科卡式注射器》.pdf
  • ONORM EN 301-1992 Adhesives phenolic and aminoplastic for load bearing timber structures - Classification and Performance requirements《负荷轴承木结构的粘结剂、苯酚和氨基塑料 分类和性能要求》.pdf ONORM EN 301-1992 Adhesives phenolic and aminoplastic for load bearing timber structures - Classification and Performance requirements《负荷轴承木结构的粘结剂、苯酚和氨基塑料 分类和性能要求》.pdf
  • ONORM EN 302-1-1992 Adhesives for load bearing timber structures - Test methods - Determination of bond strenght in longitudinal tensile shear《承重木结构用胶粘剂 测试方法纵向拉伸剪切强度中粘接强度的测定》.pdf ONORM EN 302-1-1992 Adhesives for load bearing timber structures - Test methods - Determination of bond strenght in longitudinal tensile shear《承重木结构用胶粘剂 测试方法纵向拉伸剪切强度中粘接强度的测定》.pdf
  • ONORM EN 302-2-1992 Adhesives for load bearing timber structures - Test methods - Determination of resistance to delamination (Laboratory method)《承重木结构用胶粘剂 测试方法 抗脱胶性能的测定(实验室法)》.pdf ONORM EN 302-2-1992 Adhesives for load bearing timber structures - Test methods - Determination of resistance to delamination (Laboratory method)《承重木结构用胶粘剂 测试方法 抗脱胶性能的测定(实验室法)》.pdf
  • ONORM EN 302-3-1992 Adhesives for load bearing timber structures - Test methods - Determination oi the effect of acid damage to wood fibres by temperature and humidity cycling on t.pdf ONORM EN 302-3-1992 Adhesives for load bearing timber structures - Test methods - Determination oi the effect of acid damage to wood fibres by temperature and humidity cycling on t.pdf
  • ONORM EN 302-4-1992 Adhesives for load bearing timber structures - Test methods - Determination of the effects of wood shrinkage on the shear strength《承重木结构用胶粘剂 测试方法 木材收缩对剪切强度影响的测定.pdf ONORM EN 302-4-1992 Adhesives for load bearing timber structures - Test methods - Determination of the effects of wood shrinkage on the shear strength《承重木结构用胶粘剂 测试方法 木材收缩对剪切强度影响的测定.pdf
  • ONORM EN 30202-1-1993 Financial transaction cards - Security architecture of financial transaction Systems using integrated circuit cards - Part 1 Card life cycle (ISO 10202-1 1991.pdf ONORM EN 30202-1-1993 Financial transaction cards - Security architecture of financial transaction Systems using integrated circuit cards - Part 1 Card life cycle (ISO 10202-1 1991.pdf
  • ONORM EN 3026-1994 Aerospace series Test method for dry film lubricants Corrosion test on steels specimens《航空航天系列 干膜润滑的试验方法 钢试件的腐蚀性试验》.pdf ONORM EN 3026-1994 Aerospace series Test method for dry film lubricants Corrosion test on steels specimens《航空航天系列 干膜润滑的试验方法 钢试件的腐蚀性试验》.pdf
  • ONORM EN 3027-1994 Aerospace series Test method for dry film lubricants Salt spray test《航空航天系列 干膜润滑的试验方法 盐雾测试》.pdf ONORM EN 3027-1994 Aerospace series Test method for dry film lubricants Salt spray test《航空航天系列 干膜润滑的试验方法 盐雾测试》.pdf
  • 相关搜索

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

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