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

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

1、计算机二级 JAVA-76及答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序中定义了不同类型的变量 a、b 和 c,其中 a为字符串型变量,b 为单精度浮点型变量,c 为双精度浮点型变量,最后打印输出。 public class exam_88 public static void main(String args) _a=“f“; _b=0.23f; _c=0.7e-3; System.out.println(“a=“+a); System.out.println(“b=“+b); System.out.println(“c=“+

2、c); (分数:30.00)_2.本程序的功能是求 1100 的自然数的累加,并打印输出计算结果。 public class exam_89 public static void main(String args) int sum=0; int i=1; for(;) if(_) sum=sum+i; else _; _; System.out.println(“sum=“+sum); (分数:30.00)_3.本程序的功能是访问类 exam_90中的成员变量 num1和 num2。程序中使用构造方法将整型变量 a和双精度浮点型变量 b的赋给类的成员变量 num1和 num2,然后定义类的对象

3、 ex,最后通过对象 ex方法类的成员变量 num1和 num2,其中变量 a为 23,变量 b为 4.5。 public class exam_90 int num1; double num2; public exam_90(_) num1=a; num2=b; public static void main(String args) int a=23; double b=4.5; exam_90 ex=new exam_90(a,b); System.out.println(“num1=“+_); System.out.println(“num2=“+_); (分数:40.00)_计算机二

4、级 JAVA-76答案解析(总分:100.00,做题时间:90 分钟)一、基本操作题(总题数:3,分数:100.00)1.本程序中定义了不同类型的变量 a、b 和 c,其中 a为字符串型变量,b 为单精度浮点型变量,c 为双精度浮点型变量,最后打印输出。 public class exam_88 public static void main(String args) _a=“f“; _b=0.23f; _c=0.7e-3; System.out.println(“a=“+a); System.out.println(“b=“+b); System.out.println(“c=“+c); (

5、分数:30.00)_正确答案:()解析:第 1处:String 第 2处:float 第 3处:double2.本程序的功能是求 1100 的自然数的累加,并打印输出计算结果。 public class exam_89 public static void main(String args) int sum=0; int i=1; for(;) if(_) sum=sum+i; else _; _; System.out.println(“sum=“+sum); (分数:30.00)_正确答案:()解析:第 1处:i=100 第 2处:break 第 3处:i+(或 i=i+1或 i+=1)3

6、本程序的功能是访问类 exam_90中的成员变量 num1和 num2。程序中使用构造方法将整型变量 a和双精度浮点型变量 b的赋给类的成员变量 num1和 num2,然后定义类的对象 ex,最后通过对象 ex方法类的成员变量 num1和 num2,其中变量 a为 23,变量 b为 4.5。 public class exam_90 int num1; double num2; public exam_90(_) num1=a; num2=b; public static void main(String args) int a=23; double b=4.5; exam_90 ex=new exam_90(a,b); System.out.println(“num1=“+_); System.out.println(“num2=“+_); (分数:40.00)_正确答案:()解析:第 1处:int a,double b 第 2处:ex.num1 第 3处:ex.num2

展开阅读全文
相关资源
猜你喜欢
  • ASTM F2006-2017 Standard Safety Specification for Window Fall Prevention Devices for Non-Emergency Escape (Egress) and Rescue (Ingress) Windows《非紧急逃生(出口)和救援(入口)窗户防坠装置的标准安全规格》.pdf ASTM F2006-2017 Standard Safety Specification for Window Fall Prevention Devices for Non-Emergency Escape (Egress) and Rescue (Ingress) Windows《非紧急逃生(出口)和救援(入口)窗户防坠装置的标准安全规格》.pdf
  • ASTM F2007-2007 Standard Practice for Classification Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的分类、设计、制造和操作用标准实施规程》.pdf ASTM F2007-2007 Standard Practice for Classification Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的分类、设计、制造和操作用标准实施规程》.pdf
  • ASTM F2007-2007a Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的分类、设计、制造和操作用标准实施规程》.pdf ASTM F2007-2007a Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的分类、设计、制造和操作用标准实施规程》.pdf
  • ASTM F2007-2011 Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许卡丁车及设施的设计 制造和运行的标准操作规程》.pdf ASTM F2007-2011 Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许卡丁车及设施的设计 制造和运行的标准操作规程》.pdf
  • ASTM F2007-2012 Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的设计 制造和操作标准操作规程》.pdf ASTM F2007-2012 Standard Practice for Design Manufacture and Operation of Concession Go-Karts and Facilities《特许小型赛车及设备的设计 制造和操作标准操作规程》.pdf
  • ASTM F2008-2000(2006) Standard Guide for Qualitative Observations of Skimmer Performance《推土机性能的定性观察标准指南》.pdf ASTM F2008-2000(2006) Standard Guide for Qualitative Observations of Skimmer Performance《推土机性能的定性观察标准指南》.pdf
  • ASTM F2008-2000(2012)e1 Standard Guide for Qualitative Observations of Skimmer Performance《推土机性能的定性观察标准指南》.pdf ASTM F2008-2000(2012)e1 Standard Guide for Qualitative Observations of Skimmer Performance《推土机性能的定性观察标准指南》.pdf
  • ASTM F2008-2000(2018) Standard Guide for Qualitative Observations of Skimmer Performance《撇渣器性能定性观察的标准指南》.pdf ASTM F2008-2000(2018) Standard Guide for Qualitative Observations of Skimmer Performance《撇渣器性能定性观察的标准指南》.pdf
  • ASTM F2009-2000(2005) Standard Test Method for Determining the Axial Disassembly Force of Taper Connections of Modular Prostheses《测定模块化假体锥形连接的轴向拆解力的标准试验方法》.pdf ASTM F2009-2000(2005) Standard Test Method for Determining the Axial Disassembly Force of Taper Connections of Modular Prostheses《测定模块化假体锥形连接的轴向拆解力的标准试验方法》.pdf
  • 相关搜索
    资源标签

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

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