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

展开阅读全文
相关资源
猜你喜欢
  • API RP 67-2007 Recommended Practice for Oilfield Explosives Safety (Second Edition)《油田用炸药安全管理.第2版》.pdf API RP 67-2007 Recommended Practice for Oilfield Explosives Safety (Second Edition)《油田用炸药安全管理.第2版》.pdf
  • API RP 68-1998 Recommended Practice for Oil and Gas Well Servicing and Workover Operations Involving Hydrogen Sulfide (FIRST EDITION)《涉及硫化氢的石油和天然气井、修井作业推荐实施规程.第一版》.pdf API RP 68-1998 Recommended Practice for Oil and Gas Well Servicing and Workover Operations Involving Hydrogen Sulfide (FIRST EDITION)《涉及硫化氢的石油和天然气井、修井作业推荐实施规程.第一版》.pdf
  • API RP 691 DATA SHEET-2017 Risk-based Machinery Management - Equipment Data Sheet (Includes Excel sheet) .pdf API RP 691 DATA SHEET-2017 Risk-based Machinery Management - Equipment Data Sheet (Includes Excel sheet) .pdf
  • API RP 6DR RUSSIAN-2012 Recommended Practice for the Repair and Remanufacture of Pipeline Valves (Second Edition) .pdf API RP 6DR RUSSIAN-2012 Recommended Practice for the Repair and Remanufacture of Pipeline Valves (Second Edition) .pdf
  • API RP 6DR-2012 Recommended Practice for the Repair and Remanufacture of Pipeline Valves (Second Edition)《管道阀门的维修和再制造的推荐实施规程.第2版.[代替 API RP 6DR RUSSIAN标准]》.pdf API RP 6DR-2012 Recommended Practice for the Repair and Remanufacture of Pipeline Valves (Second Edition)《管道阀门的维修和再制造的推荐实施规程.第2版.[代替 API RP 6DR RUSSIAN标准]》.pdf
  • API RP 6HT-2013 Heat Treatment and Testing of Carbon and Low Alloy Steel Large Cross Section and Critical Section Components (Second Edition)《大断面和临界断面部件的热处理和测试》.pdf API RP 6HT-2013 Heat Treatment and Testing of Carbon and Low Alloy Steel Large Cross Section and Critical Section Components (Second Edition)《大断面和临界断面部件的热处理和测试》.pdf
  • API RP 70-2003 Security for Offshore Oil and Natural Gas Operations (First Edition)《近海石油和天然气业务的安全.第1版》.pdf API RP 70-2003 Security for Offshore Oil and Natural Gas Operations (First Edition)《近海石油和天然气业务的安全.第1版》.pdf
  • API RP 70I-2004 Security for Worldwide Offshore Oil and Natural Gas Operations (FIRST EDITION)《全球海上石油和天然气操作的安全.第1版》.pdf API RP 70I-2004 Security for Worldwide Offshore Oil and Natural Gas Operations (FIRST EDITION)《全球海上石油和天然气操作的安全.第1版》.pdf
  • API RP 74-2001 Recommended Practice for Occupational Safety for Onshore Oil and Gas Production Operation (FIRST EDITION)《陆上石油和天然气生产业务的职业防灾推荐作法.第1版》.pdf API RP 74-2001 Recommended Practice for Occupational Safety for Onshore Oil and Gas Production Operation (FIRST EDITION)《陆上石油和天然气生产业务的职业防灾推荐作法.第1版》.pdf
  • 相关搜索

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

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