【计算机类职业资格】计算机二级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

展开阅读全文
相关资源
猜你喜欢
  • ASTM D6289-2003 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《模制热固性塑料模型尺寸收缩率测量的标准试验方法》.pdf ASTM D6289-2003 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《模制热固性塑料模型尺寸收缩率测量的标准试验方法》.pdf
  • ASTM D6289-2008 866 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《测量由模制热固塑料的模型尺寸收缩的标准试验方法》.pdf ASTM D6289-2008 866 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《测量由模制热固塑料的模型尺寸收缩的标准试验方法》.pdf
  • ASTM D6289-2013 red 9375 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《测量模塑热固塑料模塑尺寸收缩的标准试验方法》.pdf ASTM D6289-2013 red 9375 Standard Test Method for Measuring Shrinkage from Mold Dimensions of Molded Thermosetting Plastics《测量模塑热固塑料模塑尺寸收缩的标准试验方法》.pdf
  • ASTM D6290-2005 Standard Test Method for Color Determination of Plastic Pellets《塑料丸粒颜色测定的标准试验方法》.pdf ASTM D6290-2005 Standard Test Method for Color Determination of Plastic Pellets《塑料丸粒颜色测定的标准试验方法》.pdf
  • ASTM D6290-2005e1 1250 Standard Test Method for Color Determination of Plastic Pellets《塑料颗粒颜色测定的标准试验方法》.pdf ASTM D6290-2005e1 1250 Standard Test Method for Color Determination of Plastic Pellets《塑料颗粒颜色测定的标准试验方法》.pdf
  • ASTM D6290-2013 red 2501 Standard Test Method for Color Determination of Plastic Pellets《塑料丸粒颜色测定的标准试验方法》.pdf ASTM D6290-2013 red 2501 Standard Test Method for Color Determination of Plastic Pellets《塑料丸粒颜色测定的标准试验方法》.pdf
  • ASTM D6294 D6294M-1998(2009)e1 3750 Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试.pdf ASTM D6294 D6294M-1998(2009)e1 3750 Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试.pdf
  • ASTM D6294 D6294M-2013 red 2414 Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试验方法》.pdf ASTM D6294 D6294M-2013 red 2414 Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试验方法》.pdf
  • ASTM D6294-1998(2003) Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试验方法》.pdf ASTM D6294-1998(2003) Standard Test Method for Corrosion Resistance of Ferrous Metal Fastener Assemblies Used in Roofing and Waterproofing《用于屋顶和防水屋顶的铁金属紧固件组件的耐腐蚀性的标准试验方法》.pdf
  • 相关搜索

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

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