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

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

1、计算机二级 JAVA-131 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序的功能是计算二维数组 arr 中所有元素的和,并打印输出计算结果。 public class exam_97 public static void main(String args) int arr=34,21,45,67,20,23,10,3,45,22,3,79; int i=0,j=0; int sum=0; outer:while(true) if(i=arr.length) _; while(true) if(j=arri.length)

2、 _; j=0; continue outer; sum=sum+arrij; _; System.out.println(“sum=“+sum); (分数:30.00)_2.本程序找出字符串 str 中所有的小写字母(az),并打印输出。 public class exam_98 public static void main(String args) String str=“D241ERaeERA452ADdfEAFd5T“; char c; int i=0; do c=_; if(_) System.out.print(c+“,“); i+; while(_); (分数:30.00)_3

3、下面的程序中,指定变量 b 为字节型,变量 f 为单精度实型,变量 l 为 64 位整型。 public class exam_99 public static void main(String args) _b=49; _f=8.9f; _l=0xfedl; System.out.println(“b=“+b); System.out.println(“f=“+f); System.out.println(“l=“+l); (分数:40.00)_计算机二级 JAVA-131 (1)答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序

4、的功能是计算二维数组 arr 中所有元素的和,并打印输出计算结果。 public class exam_97 public static void main(String args) int arr=34,21,45,67,20,23,10,3,45,22,3,79; int i=0,j=0; int sum=0; outer:while(true) if(i=arr.length) _; while(true) if(j=arri.length) _; j=0; continue outer; sum=sum+arrij; _; System.out.println(“sum=“+sum);

5、 (分数:30.00)_正确答案:()解析:第 1 处:break 第 2 处:i+(或 i=i+1 或 i+=1) 第 3 处:j+(或 j=j+1 或 j+=1)2.本程序找出字符串 str 中所有的小写字母(az),并打印输出。 public class exam_98 public static void main(String args) String str=“D241ERaeERA452ADdfEAFd5T“; char c; int i=0; do c=_; if(_) System.out.print(c+“,“); i+; while(_); (分数:30.00)_正确答案:()解析:第 1 处:str.charAt(i) 第 2 处:c=“a“ _f=8.9f; _l=0xfedl; System.out.println(“b=“+b); System.out.println(“f=“+f); System.out.println(“l=“+l); (分数:40.00)_正确答案:()解析:第 1 处:byte 第 2 处:float 第 3 处:long

展开阅读全文
相关资源
猜你喜欢
  • CSN EN 27842-1994 Automatic steam traps Determination of discharge capacity Test methods《自动疏水器 放电容量的测定 测试方法》.pdf CSN EN 27842-1994 Automatic steam traps Determination of discharge capacity Test methods《自动疏水器 放电容量的测定 测试方法》.pdf
  • CSN EN 283-1993 Swap bodies Testing《互换机构 测试》.pdf CSN EN 283-1993 Swap bodies Testing《互换机构 测试》.pdf
  • CSN EN 286-2-1994 Simple unfired pressure vessels designed to contain air or nitrogen Part 2 Pressure vessels for air braking and auxiliary systems for motor vehicles and their tra.pdf CSN EN 286-2-1994 Simple unfired pressure vessels designed to contain air or nitrogen Part 2 Pressure vessels for air braking and auxiliary systems for motor vehicles and their tra.pdf
  • CSN EN 28630-1-1994 Information processing - Data interchange on 130mm (5 25in) felxible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tracks.pdf CSN EN 28630-1-1994 Information processing - Data interchange on 130mm (5 25in) felxible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tracks.pdf
  • CSN EN 28630-2+A1-1994 Information processing - Data interchange on 130mm (5 25in) flexible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tra.pdf CSN EN 28630-2+A1-1994 Information processing - Data interchange on 130mm (5 25in) flexible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tra.pdf
  • CSN EN 28630-3+A1-1994 Information processing - Data interchange on 130mm (5 25in) flexible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tra.pdf CSN EN 28630-3+A1-1994 Information processing - Data interchange on 130mm (5 25in) flexible disk cartridges using modified frequency modulation recording at 13 262 ftprad on 80 tra.pdf
  • CSN EN 28654-1995 Colours of gold alloys - Definition range of colours and designation (ISO 8654 1987)《金合金颜色 颜色的定义范围及命名 (ISO 8654-1987)》.pdf CSN EN 28654-1995 Colours of gold alloys - Definition range of colours and designation (ISO 8654 1987)《金合金颜色 颜色的定义范围及命名 (ISO 8654-1987)》.pdf
  • CSN EN 28662-1-1995 Hand-held portable power tools - Measurement of vibrations at the handle - Part 1 General《手 持便携式电动工具 把手振动力的测量 第1部分:总则》.pdf CSN EN 28662-1-1995 Hand-held portable power tools - Measurement of vibrations at the handle - Part 1 General《手 持便携式电动工具 把手振动力的测量 第1部分:总则》.pdf
  • CSN EN 29073-1-1994 Textiles - Test methods for nonwovens - Part 1 Determination of mass per unit area《纺织品 非梭织纺织品的试验方法 第1部分:单位面积质量测定》.pdf CSN EN 29073-1-1994 Textiles - Test methods for nonwovens - Part 1 Determination of mass per unit area《纺织品 非梭织纺织品的试验方法 第1部分:单位面积质量测定》.pdf
  • 相关搜索

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

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