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

展开阅读全文
相关资源
猜你喜欢
  • ANSI ISO ASTM 51956-2013 Standard Practice for Use of a Thermoluminescence-Dosimetry System (TLD System) for Radiation Processing.pdf ANSI ISO ASTM 51956-2013 Standard Practice for Use of a Thermoluminescence-Dosimetry System (TLD System) for Radiation Processing.pdf
  • ANSI ISO ASTM 52116-2013 Standard Practice for Dosimetry for a Self-Contained Dry-Storage Gamma Irradiator.pdf ANSI ISO ASTM 52116-2013 Standard Practice for Dosimetry for a Self-Contained Dry-Storage Gamma Irradiator.pdf
  • ANSI ISO ASTM 52628-2013 Standard Practice for Dosimetry in Radiation Processing.pdf ANSI ISO ASTM 52628-2013 Standard Practice for Dosimetry in Radiation Processing.pdf
  • ANSI ISO ASTM 52701-2013 Standard Guide for Performance Characterization of Dosimeters and Dosimetry Systems for Use in Radiation Processing.pdf ANSI ISO ASTM 52701-2013 Standard Guide for Performance Characterization of Dosimeters and Dosimetry Systems for Use in Radiation Processing.pdf
  • ANSI ISO IEC 10021-9-1995 Information technology - Message Handling Systems (MHS) - Part 9 Electronic Data Interchange Messaging System Adopted by INCITS《信息技术.电文处理系统(MHS).第9部分 INCI.pdf ANSI ISO IEC 10021-9-1995 Information technology - Message Handling Systems (MHS) - Part 9 Electronic Data Interchange Messaging System Adopted by INCITS《信息技术.电文处理系统(MHS).第9部分 INCI.pdf
  • ANSI ISO IEC 10026-1-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 1 OSI TP Model (Adopted by INCITS)《信息技术.开放系统互联.分布式事务处理.第1部分 IN.pdf ANSI ISO IEC 10026-1-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 1 OSI TP Model (Adopted by INCITS)《信息技术.开放系统互联.分布式事务处理.第1部分 IN.pdf
  • ANSI ISO IEC 10026-2-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 2 OSI TP Service《信息技术.开放系统互连分布式事务处理.第2部分 INCITS采纳的OSI TP服务》.pdf ANSI ISO IEC 10026-2-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 2 OSI TP Service《信息技术.开放系统互连分布式事务处理.第2部分 INCITS采纳的OSI TP服务》.pdf
  • ANSI ISO IEC 10026-3-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 3 Protocol specification (Adopted by INCITS)《信息技术.开放系统互连分布式事务处.pdf ANSI ISO IEC 10026-3-1998 Information technology Open Systems Interconnection Distributed Transaction Processing Part 3 Protocol specification (Adopted by INCITS)《信息技术.开放系统互连分布式事务处.pdf
  • ANSI ISO IEC 10026-4-1995 Information technology Open Systems Interconnection Distributed Transaction Processing Protocol Implementation Conformance Statement (PIGS) proforma (Adop.pdf ANSI ISO IEC 10026-4-1995 Information technology Open Systems Interconnection Distributed Transaction Processing Protocol Implementation Conformance Statement (PIGS) proforma (Adop.pdf
  • 相关搜索
    资源标签

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

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