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

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

1、计算机二级 JAVA-126 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序统计字符数组 c 中小写字母(az)的个数,并将它们变成大写字母(已知字符 a 对应的 ASCII 比A 对应的 ASCII 大 32)。 public class exam_79 public static void main(String args) char c=“a“,“D“,“W“,“f“,“q“,“P“,“i“,“o“; _; for(int i=0;ic.length;i+) if(ci=“a“ _; System.out.print

2、ln(“sum=“+sum); System.out.println(c); (分数:30.00)_2.本程序求整型数组 a(a=45,22,91,87,45,96,78)中的最大元素,并打印输出计算结果。 public class exam_80 public static void main(String args) int a=45,22,91,87,45,96,78); _; int i=1; while(_) if(aimax) _; i+; System.out.println(“Max=“+max); (分数:30.00)_3.本程序找出字符串数组 arr=“welcome“,“

3、China“,“hi“,“congratulation“,“great“;中长度最大的元素,并打印输出。 public class exam_81 public static void main(String args) _arr=“welcome“,“China“,“hi“,“congratulation“,“great“; int i=0; int pos=0; int length=0; while(_) if(arri.length()length) length=arri.length(); _; i+; System.out.println(“The string of max l

4、ength is:“+arrpos); (分数:40.00)_计算机二级 JAVA-126 (1)答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序统计字符数组 c 中小写字母(az)的个数,并将它们变成大写字母(已知字符 a 对应的 ASCII 比A 对应的 ASCII 大 32)。 public class exam_79 public static void main(String args) char c=“a“,“D“,“W“,“f“,“q“,“P“,“i“,“o“; _; for(int i=0;ic.length;i+)

5、 if(ci=“a“ _; System.out.println(“sum=“+sum); System.out.println(c); (分数:30.00)_正确答案:()解析:第 1 处:int sum=0 第 2 处:(char) 第 3 处:sum+(或 sum=sum+1 或 sum+=1)2.本程序求整型数组 a(a=45,22,91,87,45,96,78)中的最大元素,并打印输出计算结果。 public class exam_80 public static void main(String args) int a=45,22,91,87,45,96,78); _; int i

6、1; while(_) if(aimax) _; i+; System.out.println(“Max=“+max); (分数:30.00)_正确答案:()解析:第 1 处:int max=a0 第 2 处:ia.length 第 3 处:max=ai3.本程序找出字符串数组 arr=“welcome“,“China“,“hi“,“congratulation“,“great“;中长度最大的元素,并打印输出。 public class exam_81 public static void main(String args) _arr=“welcome“,“China“,“hi“,“congratulation“,“great“; int i=0; int pos=0; int length=0; while(_) if(arri.length()length) length=arri.length(); _; i+; System.out.println(“The string of max length is:“+arrpos); (分数:40.00)_正确答案:()解析:第 1 处:String 第 2 处:iarr.length 第 3 处:pos=i

展开阅读全文
相关资源
猜你喜欢
  • BS EN ISO 5832-3-2016 Implants for surgery Metallic materials Wrought titanium 6-aluminium 4-vanadium alloy《外科植入物 金属材料 6-铝4-钒精细钛合金》.pdf BS EN ISO 5832-3-2016 Implants for surgery Metallic materials Wrought titanium 6-aluminium 4-vanadium alloy《外科植入物 金属材料 6-铝4-钒精细钛合金》.pdf
  • BS EN ISO 584-1998 Plastics - Unsaturated polyester resins - Determination of reactivity at 80 C (conventional method)《塑料 不饱和聚酯树脂 80℃时的反应性测定(常规方法)》.pdf BS EN ISO 584-1998 Plastics - Unsaturated polyester resins - Determination of reactivity at 80 C (conventional method)《塑料 不饱和聚酯树脂 80℃时的反应性测定(常规方法)》.pdf
  • BS EN ISO 5840-1-2015 Cardiovascular implants Cardiac valve prostheses General requirements《心血管植入物 心脏瓣膜假体 通用要求》.pdf BS EN ISO 5840-1-2015 Cardiovascular implants Cardiac valve prostheses General requirements《心血管植入物 心脏瓣膜假体 通用要求》.pdf
  • BS EN ISO 5840-2-2015 Cardiovascular implants Cardiac valve prostheses Surgically implanted heart valve substitutes《心血管植入物 心脏瓣膜假体 外科植入心脏瓣膜替代物》.pdf BS EN ISO 5840-2-2015 Cardiovascular implants Cardiac valve prostheses Surgically implanted heart valve substitutes《心血管植入物 心脏瓣膜假体 外科植入心脏瓣膜替代物》.pdf
  • BS EN ISO 5840-3-2013 Cardiovascular implants Cardiac valve prostheses Heart valve substitutes implanted by transcatheter technique《心血管植入物 心脏瓣膜假体 由经导管技术植入的心脏瓣膜假体》.pdf BS EN ISO 5840-3-2013 Cardiovascular implants Cardiac valve prostheses Heart valve substitutes implanted by transcatheter technique《心血管植入物 心脏瓣膜假体 由经导管技术植入的心脏瓣膜假体》.pdf
  • BS EN ISO 5845-1-1999 Technical drawings - Simplified representation of the assemby of parts with fasteners - General principles《技术图纸 用紧固件连接的零件组配的简化表示法 一般原则》.pdf BS EN ISO 5845-1-1999 Technical drawings - Simplified representation of the assemby of parts with fasteners - General principles《技术图纸 用紧固件连接的零件组配的简化表示法 一般原则》.pdf
  • BS EN ISO 591-1-2000 Titanium dioxide pigments for paints - Specifications and methods of test《涂料用二氧化钛颜料 规范和试验方法》.pdf BS EN ISO 591-1-2000 Titanium dioxide pigments for paints - Specifications and methods of test《涂料用二氧化钛颜料 规范和试验方法》.pdf
  • BS EN ISO 5912-2011 Camping tents《野营帐篷》.pdf BS EN ISO 5912-2011 Camping tents《野营帐篷》.pdf
  • BS EN ISO 5923-2012 Equipment for fire protection and fire fighting Fire extinguishing media Carbon dioxide《火灾防护和消防设备 灭火介质 二氧化碳》.pdf BS EN ISO 5923-2012 Equipment for fire protection and fire fighting Fire extinguishing media Carbon dioxide《火灾防护和消防设备 灭火介质 二氧化碳》.pdf
  • 相关搜索

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

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