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

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

1、二级 JAVA机试 79及答案解析(总分:100.00,做题时间:90 分钟)一、B1基本操作题/B(总题数:1,分数:30.00)1.下面程序的功能是显示已定义的一个 3行 3列的二维数组每行的元素,并求所有元素的和并输出。请在程序的每条横线处填写一个适当的语句,使程序的功能完整。 public class ShuZu public static void main(String args) int sum=0; int b=11,12,13,21,22,23,31,32,33; for(int i=0;_i+) Systemout,print(“b“+i+“:“); for(int j=0

2、j+) System.out.print(bij+“ “); _ System.out.println(); System.out.println(“Sum=“+sum); (分数:30.00)_二、B2简单应用题/B(总题数:1,分数:40.00)2.请完成下列 Java程序。程序的输出结果:a=6,b=5。 注意:请勿改动 main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。 程序运行结果如下: (分数:40.00)_三、B3综合应用题/B(总题数:1,分数:30.00)3.下面 Applet程序的功能是统计在平面坐标系中第一象限中,半径大于 9,小于 10的圆环中坐标值

3、为整数的点有多少?并且给出其坐标值请改正程序中的错误(有下划线的语句),使程序执行后,能得到预期的结果。 注意:不改动程序的结构,不得增行或删行。 程序的执行结果为: (分数:30.00)_二级 JAVA机试 79答案解析(总分:100.00,做题时间:90 分钟)一、B1基本操作题/B(总题数:1,分数:30.00)1.下面程序的功能是显示已定义的一个 3行 3列的二维数组每行的元素,并求所有元素的和并输出。请在程序的每条横线处填写一个适当的语句,使程序的功能完整。 public class ShuZu public static void main(String args) int sum

4、0; int b=11,12,13,21,22,23,31,32,33; for(int i=0;_i+) Systemout,print(“b“+i+“:“); for(int j=0;_j+) System.out.print(bij+“ “); _ System.out.println(); System.out.println(“Sum=“+sum); (分数:30.00)_正确答案:()解析:ib.length; jbi.length; sum+=bij; 解析 本题主要考查 for循环语句。解答本题的关键是热练掌握 for循环语句的用法。在本题中,外层 for循环控制语句 for

5、int i=0;ib.length;i+)的功能是控制数组的行元素的值的输出,内层 for循环控制语句 for(int j=0;jbj.length;j+)的功能是控制二维数组每行元素的输出,sum+=bij;语句的功能是累加求和。二、B2简单应用题/B(总题数:1,分数:40.00)2.请完成下列 Java程序。程序的输出结果:a=6,b=5。 注意:请勿改动 main()主方法和其他已有语句内容,仅在下划线处填入适当的语句。 程序运行结果如下: (分数:40.00)_正确答案:()解析:a+b a-b 解析 本题主要考查变量的基本运算。解答本题的关键是理解程序的基本思想。本题的思想是不借

6、助第 3个变量来交换两个数的值。三、B3综合应用题/B(总题数:1,分数:30.00)3.下面 Applet程序的功能是统计在平面坐标系中第一象限中,半径大于 9,小于 10的圆环中坐标值为整数的点有多少?并且给出其坐标值请改正程序中的错误(有下划线的语句),使程序执行后,能得到预期的结果。 注意:不改动程序的结构,不得增行或删行。 程序的执行结果为: (分数:30.00)_正确答案:()解析:xrl; y+ continue; 解析 本题主要考查 for循环语句的基本用法。一个循环语句一般应包含 4部分内容:(1)初始化部分:用来设置循环控制的一些初始条件,如设置计数器等。(2)循环体部分:这是反复执行的一段代码,可以是单一的一条语句,也可以是复合语句(代码块)。(3)迭代部分:用来修改循环控制条件。常常在本次循环结束,下一次循环开始前执行。例如,使计数器递增或递减。 (4)判断部分:也称终止部分。是一个关系表达式或布尔逻辑表达式,其值用来判断是否满足循环终止条件。每执行一次循环都要对该表达式求值。解答循环语句题要抓住这四个部分。

展开阅读全文
相关资源
猜你喜欢
  • DIN EN 13892-8-2003 Methods of test for screed materials - Part 8 Determination of bond strength German version EN 13892-8 2002《找平材料试验方法 第8部分 粘结强度测定》.pdf DIN EN 13892-8-2003 Methods of test for screed materials - Part 8 Determination of bond strength German version EN 13892-8 2002《找平材料试验方法 第8部分 粘结强度测定》.pdf
  • DIN EN 13893-2003 Resilient laminate and textile floor coverings - Measurement of dynamic coefficient of friction on dry floor surfaces German version EN 13893 2002《弹性、叠层和织物性地板覆盖物 .pdf DIN EN 13893-2003 Resilient laminate and textile floor coverings - Measurement of dynamic coefficient of friction on dry floor surfaces German version EN 13893 2002《弹性、叠层和织物性地板覆盖物 .pdf
  • DIN EN 13894-1-2004 Products and systems for the protection and repair of concrete structures - Test methods - Determination of fatigue under dynamic loading - Part 1 During cure G.pdf DIN EN 13894-1-2004 Products and systems for the protection and repair of concrete structures - Test methods - Determination of fatigue under dynamic loading - Part 1 During cure G.pdf
  • DIN EN 13894-2-2003 Products and systems for the protection and repair of concrete structures - Test methods Determination of fatigue under dynamic loading - Part 2 After hardening.pdf DIN EN 13894-2-2003 Products and systems for the protection and repair of concrete structures - Test methods Determination of fatigue under dynamic loading - Part 2 After hardening.pdf
  • DIN EN 13895-2003 Textiles - Monofilaments - Determination of tensile properties German version EN 13895 2003《织物 单丝 抗拉特性的测定》.pdf DIN EN 13895-2003 Textiles - Monofilaments - Determination of tensile properties German version EN 13895 2003《织物 单丝 抗拉特性的测定》.pdf
  • DIN EN 13897-2005 Flexible sheets for waterproofing - Bitumen plastic and rubber sheets for roof waterproofing - Determination of watertightness after stretching at low temperature.pdf DIN EN 13897-2005 Flexible sheets for waterproofing - Bitumen plastic and rubber sheets for roof waterproofing - Determination of watertightness after stretching at low temperature.pdf
  • DIN EN 13898-2009 Machine tools - Safety - Sawing machines for cold metal (includes Amendment A1 2009) English version of DIN EN 13898 2009-09《机床 安全性 冷金属锯床(包括修改件A1-2009) 英文版本DIN EN.pdf DIN EN 13898-2009 Machine tools - Safety - Sawing machines for cold metal (includes Amendment A1 2009) English version of DIN EN 13898 2009-09《机床 安全性 冷金属锯床(包括修改件A1-2009) 英文版本DIN EN.pdf
  • DIN EN 13899-2003 Roller sports equipment - Roller skates - Safety requirements and test methods German version EN 13899 2003《滚轴运动设备 旱冰鞋 安全要求和试验方法》.pdf DIN EN 13899-2003 Roller sports equipment - Roller skates - Safety requirements and test methods German version EN 13899 2003《滚轴运动设备 旱冰鞋 安全要求和试验方法》.pdf
  • DIN EN 1390-2006 Wood preservatives - Determination of the eradicant action against Hylotrupes bajulus (Linnaeus) larvae - Laboratory method German version EN 1390 2006《木材防腐剂 家天牛幼虫.pdf DIN EN 1390-2006 Wood preservatives - Determination of the eradicant action against Hylotrupes bajulus (Linnaeus) larvae - Laboratory method German version EN 1390 2006《木材防腐剂 家天牛幼虫.pdf
  • 相关搜索

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

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