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

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

1、计算机二级 JAVA-48及答案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序提示输入年份,然后判断该年份是否为闰年。 import Java.io.*; public class exam_13 public static void main(String args) InputStreamReader ir; BufferedReader in; ir=new InputStreamReader(System.in); in=new BufferedReader(ir); int year=1900; System.out.

2、print(“请输入年份:“); try String s=in.readLine(); _; _(Exception e) if(_) System.out.println(year+“是闰年“); else System.out.println(year+“不是闰年“); (分数:30.00)_2.本程序提示输入月份,然后判断该月份的天数,如果输入的是 2月份,则天数按 28天计。 import java.io.*; public class exam_14 public static void main(String args) InputStreamReader ir; Buffere

3、dReader in; ir=new InputStreamReader(System.in); in=new BufferedReader(ir); int month=1; int day=0; System.out.print(“请输入月份:“); try _; month=Integer.parseInt(s); catch(Exception e) switch(month) case 1: case 3: case 5: case 7: case 8: case 10: case 12: _; case 4: case 6: case 9: case 11: _; case 2:

4、day=28; System.out.println(month+“月有“+day+“天“); (分数:30.00)_3.本程序定义了一个长度为 50的一维数组,并且分别将 150 赋给数组中的各个元素,最后输出数组元素对应的值。 public class exam_15 public static void main(String args) _; arr=_; for(int i=0; iarr.length; i+) _; for(int i=0; iarr.length; i+) System.out.print(arri+“ “); (分数:40.00)_计算机二级 JAVA-48答

5、案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序提示输入年份,然后判断该年份是否为闰年。 import Java.io.*; public class exam_13 public static void main(String args) InputStreamReader ir; BufferedReader in; ir=new InputStreamReader(System.in); in=new BufferedReader(ir); int year=1900; System.out.print(“请输入年份:“)

6、 try String s=in.readLine(); _; _(Exception e) if(_) System.out.println(year+“是闰年“); else System.out.println(year+“不是闰年“); (分数:30.00)_正确答案:(year=Integer.parseInt(s) catch year%4=0 public class exam_14 public static void main(String args) InputStreamReader ir; BufferedReader in; ir=new InputStreamRe

7、ader(System.in); in=new BufferedReader(ir); int month=1; int day=0; System.out.print(“请输入月份:“); try _; month=Integer.parseInt(s); catch(Exception e) switch(month) case 1: case 3: case 5: case 7: case 8: case 10: case 12: _; case 4: case 6: case 9: case 11: _; case 2: day=28; System.out.println(month

8、月有“+day+“天“); (分数:30.00)_正确答案:(String s=in.readLine() day=31; break day=30; break)解析:3.本程序定义了一个长度为 50的一维数组,并且分别将 150 赋给数组中的各个元素,最后输出数组元素对应的值。 public class exam_15 public static void main(String args) _; arr=_; for(int i=0; iarr.length; i+) _; for(int i=0; iarr.length; i+) System.out.print(arri+“ “); (分数:40.00)_正确答案:(intarr(或 int arr) new int50 arri=i+1)解析:

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 14735-2005 Characterization of waste - Preparation of waste samples for ecotoxicity tests English version of DIN EN 14735《废弃物表征 生态毒性试验用废弃物样品的制备》.pdf DIN EN 14735-2005 Characterization of waste - Preparation of waste samples for ecotoxicity tests English version of DIN EN 14735《废弃物表征 生态毒性试验用废弃物样品的制备》.pdf
  • DIN EN 1474-2-2009 Installation and equipment for liquefied natural gas - Design and testing of marine transfer systems - Part 2 Design and testing of transfer hoses English versio.pdf DIN EN 1474-2-2009 Installation and equipment for liquefied natural gas - Design and testing of marine transfer systems - Part 2 Design and testing of transfer hoses English versio.pdf
  • DIN EN 1474-3-2009 Installation and equipment for liquefied natural gas - Design and testing of marine transfer systems - Part 3 Offshore transfer systems English version of DIN EN.pdf DIN EN 1474-3-2009 Installation and equipment for liquefied natural gas - Design and testing of marine transfer systems - Part 3 Offshore transfer systems English version of DIN EN.pdf
  • DIN EN 14741-2006 en 7022 Thermoplastics piping and ducting systems - Joints for buried non-pressure applications - Test method for the long-term sealing performance of joints with.pdf DIN EN 14741-2006 en 7022 Thermoplastics piping and ducting systems - Joints for buried non-pressure applications - Test method for the long-term sealing performance of joints with.pdf
  • DIN EN 14742-2015 Characterization of sludges - Laboratory chemical conditioning procedure German version EN 14742 2015《污泥的特性 试验室化学条件程序 德文版本EN 14742-2015》.pdf DIN EN 14742-2015 Characterization of sludges - Laboratory chemical conditioning procedure German version EN 14742 2015《污泥的特性 试验室化学条件程序 德文版本EN 14742-2015》.pdf
  • DIN EN 14743-2007 Water conditioning equipment inside buildings - Softeners - nRequirements for performance safety and testing(includes Amendment A1 2007) nEnglish version EN 14743.pdf DIN EN 14743-2007 Water conditioning equipment inside buildings - Softeners - nRequirements for performance safety and testing(includes Amendment A1 2007) nEnglish version EN 14743.pdf
  • DIN EN 14744-2006 Inland navigation vessels and sea-going vessels - Navigation light English version of DIN EN 14744 2006《内陆导航设备和海上导航设备 导航灯》.pdf DIN EN 14744-2006 Inland navigation vessels and sea-going vessels - Navigation light English version of DIN EN 14744 2006《内陆导航设备和海上导航设备 导航灯》.pdf
  • DIN EN 14749-2016 Furniture - Domestic and kitchen storage units and kitchen-worktops - Safety requirements and test methods German version EN 14749 2016《家具 家庭厨房贮藏设备和厨房台面 安全要求和试验方法.pdf DIN EN 14749-2016 Furniture - Domestic and kitchen storage units and kitchen-worktops - Safety requirements and test methods German version EN 14749 2016《家具 家庭厨房贮藏设备和厨房台面 安全要求和试验方法.pdf
  • DIN EN 14750-1-2006 Railway applications - Air conditioning for urban and suburban rolling stock - Part 1 Comfort parameters English version of DIN EN 14750-1 2006-08《轨道交通 城市和郊区铁路车.pdf DIN EN 14750-1-2006 Railway applications - Air conditioning for urban and suburban rolling stock - Part 1 Comfort parameters English version of DIN EN 14750-1 2006-08《轨道交通 城市和郊区铁路车.pdf
  • 相关搜索

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

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