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

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

1、计算机二级 JAVA-122 (1)及答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序是计算自然数 120 的和。 public class exam_22 public static void main(String args) int n=20; _; do sum=sum+n; _; while(_); System.out.println(“sum=“+sum); (分数:30.00)_2.本程序的功能是用冒泡法对数组元素 arr=30,1,-9,70进行排列(从小到大)。冒泡法排序就是比较相邻的两个元素的大小,然后把小的元

2、素交换到前面。 public class exam_23 public static void main(String args) int i, j; int arr=30,1,-9,70); int n=_; for(i=0; in-1; i+) for(j=i+1; jn; j+) if(arriarrj) int temp=arri; _; _; for(i=0; in; i+) System.out.print(arri+“ “); (分数:30.00)_3.本程序的功能是在 Applet 小窗口的(25,25)处显示字符串“Hello World”。运行结果如下图所示。 (分数:40

3、00)_计算机二级 JAVA-122 (1)答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序是计算自然数 120 的和。 public class exam_22 public static void main(String args) int n=20; _; do sum=sum+n; _; while(_); System.out.println(“sum=“+sum); (分数:30.00)_正确答案:()解析:int sum=0 n-(或 n=n-1 或 n-=1) n0(或 n=1)2.本程序的功能是用冒泡法对数组元素

4、 arr=30,1,-9,70进行排列(从小到大)。冒泡法排序就是比较相邻的两个元素的大小,然后把小的元素交换到前面。 public class exam_23 public static void main(String args) int i, j; int arr=30,1,-9,70); int n=_; for(i=0; in-1; i+) for(j=i+1; jn; j+) if(arriarrj) int temp=arri; _; _; for(i=0; in; i+) System.out.print(arri+“ “); (分数:30.00)_正确答案:()解析:arr.length arri=arrj arrj=temp3.本程序的功能是在 Applet 小窗口的(25,25)处显示字符串“Hello World”。运行结果如下图所示。 (分数:40.00)_正确答案:()解析:public void init public void paint g.drawString (str, 25, 25)

展开阅读全文
相关资源
猜你喜欢
  • ASTM F137-2008(2018) Standard Test Method for Flexibility of Resilient Flooring Materials with Cylindrical Mandrel Apparatus.pdf ASTM F137-2008(2018) Standard Test Method for Flexibility of Resilient Flooring Materials with Cylindrical Mandrel Apparatus.pdf
  • ASTM F138-2003 Standard Specification for Wrought 18 Chromium-14 Nickel-2 5 Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢棒及钢丝的标.pdf ASTM F138-2003 Standard Specification for Wrought 18 Chromium-14 Nickel-2 5 Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢棒及钢丝的标.pdf
  • ASTM F138-2008 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢条和线材的标准规范.pdf ASTM F138-2008 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢条和线材的标准规范.pdf
  • ASTM F138-2013 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻制18铬-14镍-2 5钼不锈钢棒材及线材的标准规.pdf ASTM F138-2013 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物用锻制18铬-14镍-2 5钼不锈钢棒材及线材的标准规.pdf
  • ASTM F138-2013a Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物 UNS S31673用锻造18铬-14镍-2 5钼.pdf ASTM F138-2013a Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Bar and Wire for Surgical Implants (UNS S31673)《外科植入物 UNS S31673用锻造18铬-14镍-2 5钼.pdf
  • ASTM F139-2003 Standard Specification for Wrought 18 Chromium-14 Nickel-2 5 Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢薄板及.pdf ASTM F139-2003 Standard Specification for Wrought 18 Chromium-14 Nickel-2 5 Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢薄板及.pdf
  • ASTM F139-2008 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢薄板及带材的.pdf ASTM F139-2008 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻造18铬-14镍-2 5钼不锈钢薄板及带材的.pdf
  • ASTM F139-2012 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻制18铬-14镍-2 5钼不锈钢板材和带材的.pdf ASTM F139-2012 Standard Specification for Wrought 18Chromium-14Nickel-2 5Molybdenum Stainless Steel Sheet and Strip for Surgical Implants (UNS S31673)《外科植入物用锻制18铬-14镍-2 5钼不锈钢板材和带材的.pdf
  • ASTM F14-1980(2005) Standard Practice for Making and Testing Reference Glass-Metal Bead-Seal《标准玻璃金属胎圈密封胶的生产和试验标准实施规程》.pdf ASTM F14-1980(2005) Standard Practice for Making and Testing Reference Glass-Metal Bead-Seal《标准玻璃金属胎圈密封胶的生产和试验标准实施规程》.pdf
  • 相关搜索

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

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