【计算机类职业资格】计算机二级JAVA-127 (1)及答案解析.doc

上传人:eveningprove235 文档编号:1338199 上传时间:2019-10-17 格式:DOC 页数:4 大小:28.50KB
下载 相关 举报
【计算机类职业资格】计算机二级JAVA-127 (1)及答案解析.doc_第1页
第1页 / 共4页
【计算机类职业资格】计算机二级JAVA-127 (1)及答案解析.doc_第2页
第2页 / 共4页
【计算机类职业资格】计算机二级JAVA-127 (1)及答案解析.doc_第3页
第3页 / 共4页
【计算机类职业资格】计算机二级JAVA-127 (1)及答案解析.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机二级 JAVA-127 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序将数组 arrA 中元素按逆序存储在另一个相同长度的数组 arrB 中。 public class exam_82 public static void main(String args) int arrA=1,3,8,4,2,6,9,0,7; int arrB=_; int i=0; int j=_; for(i=0;iarrA.length;i+) arrBj=arrAi; _; System.out.println(“arrA:“+“arrB

2、); for(i=0;iarrA.length;i+) System.out.println(arrAi+“ “+arrBi); (分数:30.00)_2.本程序随机产生 10 个 09 的数字,并统计 10 个随机数中大于 5 的数字的个数。 public class exam_83 public static void main(String args) int result=0; int i=0; int randomNum; while(_) randomNum=(int)(_); System.out.print(randomNum+“,“); if(randomNum5) _;

3、 i+; System.out.println(“The num(5):“+result); (分数:30.00)_3.本程序求三个整数 a、b、c 中的最大数,并打印输出计算结果,其中,a 为 69,b 为 54,c 为 87。请将程序中空缺的部分填写适当内容,使程序能正确运行。 public class exam_84 public static void main(String args) int a=69,b=54,c=87; _; if(ab) if(ac) max=a; else _; else if(bc) _; else max=c; System.out.println(“M

4、ax num:“+max); (分数:40.00)_计算机二级 JAVA-127 (1)答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序将数组 arrA 中元素按逆序存储在另一个相同长度的数组 arrB 中。 public class exam_82 public static void main(String args) int arrA=1,3,8,4,2,6,9,0,7; int arrB=_; int i=0; int j=_; for(i=0;iarrA.length;i+) arrBj=arrAi; _; System.

5、out.println(“arrA:“+“arrB:“); for(i=0;iarrA.length;i+) System.out.println(arrAi+“ “+arrBi); (分数:30.00)_正确答案:()解析:第 1 处:new intarrA.length 第 2 处:arrA.length-1 第 3 处:j-(或 j=j-1 或 j-=1)2.本程序随机产生 10 个 09 的数字,并统计 10 个随机数中大于 5 的数字的个数。 public class exam_83 public static void main(String args) int result=0;

6、 int i=0; int randomNum; while(_) randomNum=(int)(_); System.out.print(randomNum+“,“); if(randomNum5) _; i+; System.out.println(“The num(5):“+result); (分数:30.00)_正确答案:()解析:第 1 处:i10 第 2 处:Math.random()*10 第 3 处:result+(或 result=result+1 或 result+=1)3.本程序求三个整数 a、b、c 中的最大数,并打印输出计算结果,其中,a 为 69,b 为 54,c 为 87。请将程序中空缺的部分填写适当内容,使程序能正确运行。 public class exam_84 public static void main(String args) int a=69,b=54,c=87; _; if(ab) if(ac) max=a; else _; else if(bc) _; else max=c; System.out.println(“Max num:“+max); (分数:40.00)_正确答案:()解析:第 1 处:int max 第 2 处:max=c 第 3 处:max=b

展开阅读全文
相关资源
猜你喜欢
  • ASTM F3125-2015 Standard Specification for High Strength Structural Bolts Steel and Alloy Steel Heat Treated 120 ksi (830 MPa) and 150 ksi (1040 MPa) Minimum Tensile Strength Inch .pdf ASTM F3125-2015 Standard Specification for High Strength Structural Bolts Steel and Alloy Steel Heat Treated 120 ksi (830 MPa) and 150 ksi (1040 MPa) Minimum Tensile Strength Inch .pdf
  • ASTM F3127-2016 Standard Guide for Validating Cleaning Processes Used During the Manufacture of Medical Devices《用于验证在医疗设备制造过程中使用的清洁过程的标准指南》.pdf ASTM F3127-2016 Standard Guide for Validating Cleaning Processes Used During the Manufacture of Medical Devices《用于验证在医疗设备制造过程中使用的清洁过程的标准指南》.pdf
  • ASTM F3128-2015 Standard Specification for Poly(Vinyl Chloride) (PVC) Schedule 40 Drain Waste and Vent Pipe with a Cellular Core《蜂窝芯形聚氯乙烯 (PVC) 表单40排水管 污水管和通风管的标准规格》.pdf ASTM F3128-2015 Standard Specification for Poly(Vinyl Chloride) (PVC) Schedule 40 Drain Waste and Vent Pipe with a Cellular Core《蜂窝芯形聚氯乙烯 (PVC) 表单40排水管 污水管和通风管的标准规格》.pdf
  • ASTM F3129-2016 Standard Guide for Characterization of Material Loss from Conical Taper Junctions in Total Joint Prostheses《全关节假体中锥形锥接头的材料损耗表征标准指南》.pdf ASTM F3129-2016 Standard Guide for Characterization of Material Loss from Conical Taper Junctions in Total Joint Prostheses《全关节假体中锥形锥接头的材料损耗表征标准指南》.pdf
  • ASTM F3130-2018 Standard Practice for Language Service Companies《语言服务公司的标准操作规程》.pdf ASTM F3130-2018 Standard Practice for Language Service Companies《语言服务公司的标准操作规程》.pdf
  • ASTM F3131-2014 Standard Specification for Epoxy  Cotton Raw Materials for the Use in Bearing Cages《轴承保持器使用环氧树脂 棉制原材料的标准规格》.pdf ASTM F3131-2014 Standard Specification for Epoxy Cotton Raw Materials for the Use in Bearing Cages《轴承保持器使用环氧树脂 棉制原材料的标准规格》.pdf
  • ASTM F3133-2016 Standard Practice for Classification Design Manufacture Construction Maintenance and Operation of Stationary Wave Systems《固定波系统分类 设计 制造 建造 维护和操作的标准实施规程》.pdf ASTM F3133-2016 Standard Practice for Classification Design Manufacture Construction Maintenance and Operation of Stationary Wave Systems《固定波系统分类 设计 制造 建造 维护和操作的标准实施规程》.pdf
  • ASTM F3136-2015 Standard Test Method for Oxygen Gas Transmission Rate through Plastic Film and Sheeting using a Dynamic Accumulation Method《采用动态累积法的塑料膜及薄板氧气透过率的标准试验方法》.pdf ASTM F3136-2015 Standard Test Method for Oxygen Gas Transmission Rate through Plastic Film and Sheeting using a Dynamic Accumulation Method《采用动态累积法的塑料膜及薄板氧气透过率的标准试验方法》.pdf
  • ASTM F3137-2015 Standard Specification for Headgear Used in Women&rsquo s Lacrosse (excluding Goalkeepers)《女子长曲棍球运动 (守门员除外) 使用安全帽的标准规格》.pdf ASTM F3137-2015 Standard Specification for Headgear Used in Women&rsquo s Lacrosse (excluding Goalkeepers)《女子长曲棍球运动 (守门员除外) 使用安全帽的标准规格》.pdf
  • 相关搜索

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

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