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

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

1、计算机二级 JAVA-56及答案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序统计字母 m在字符串“I am Tom, I am from China.“中出现的次数。 public class exam_37 public static void main(String args) String str=“I am Tom, I am from China.“; char c=m; int i; int sum=0; for(_) _; if(c=temp) _; System.out.println(str+“中“+c+“出

2、现了“+sum+“次“); (分数:30.00)_2.本程序判断一个字符串“Tom“是否在另外一个字符串“I am Tom, I am from China.“中出现。 public class exam_38 public static void main(String args) _; str1=:I am Tom, I am from China.“; str2=“Tom“; int i=_; if(_) System.out.println(“+str2+“is in the string:“+str1+“); else System.out.println(“+str2+“is no

3、t in the string:“+str1+“); (分数:30.00)_3.本程序的功能是将输入的字符串转换为实数,并打印输出。 import java.io.*; public class exam_39 public static void main(String args) InputStreamReader ir; BufferedReader in; ir=new InputStreamReader(_); in=new BufferedReader(ir); double d=0.0; System.out.print(“请输一个实数:“); _ String s=in.rea

4、dLine(); _; catch(Exception e) System.out.println(“你输入的实数是:“+d); (分数:40.00)_计算机二级 JAVA-56答案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序统计字母 m在字符串“I am Tom, I am from China.“中出现的次数。 public class exam_37 public static void main(String args) String str=“I am Tom, I am from China.“; char c=m

5、 int i; int sum=0; for(_) _; if(c=temp) _; System.out.println(str+“中“+c+“出现了“+sum+“次“); (分数:30.00)_正确答案:(i=0; istr. length(); i+ char temp=str. charAt(i) sum+(或 sum=sum+1或 sum+=1)解析:2.本程序判断一个字符串“Tom“是否在另外一个字符串“I am Tom, I am from China.“中出现。 public class exam_38 public static void main(String args)

6、 _; str1=:I am Tom, I am from China.“; str2=“Tom“; int i=_; if(_) System.out.println(“+str2+“is in the string:“+str1+“); else System.out.println(“+str2+“is not in the string:“+str1+“); (分数:30.00)_正确答案:(String str1, str2 str1. indexOf (str2) i!=-1)解析:3.本程序的功能是将输入的字符串转换为实数,并打印输出。 import java.io.*; pub

7、lic class exam_39 public static void main(String args) InputStreamReader ir; BufferedReader in; ir=new InputStreamReader(_); in=new BufferedReader(ir); double d=0.0; System.out.print(“请输一个实数:“); _ String s=in.readLine(); _; catch(Exception e) System.out.println(“你输入的实数是:“+d); (分数:40.00)_正确答案:(System.in try d=Double.parseDouble (s)解析:

展开阅读全文
相关资源
猜你喜欢
  • ONORM M 7863-1989 Approval testing of weiders for welding thermoplastics construction weiders《焊接热塑性塑料焊接工的录用考试 建筑焊工》.pdf ONORM M 7863-1989 Approval testing of weiders for welding thermoplastics construction weiders《焊接热塑性塑料焊接工的录用考试 建筑焊工》.pdf
  • ONORM M 7865-1990 Welding filier materials for thermoplastics requirements marking tests《热塑性塑料的焊接过滤材料 要求,标识,测试》.pdf ONORM M 7865-1990 Welding filier materials for thermoplastics requirements marking tests《热塑性塑料的焊接过滤材料 要求,标识,测试》.pdf
  • ONORM M 7870-1982 Hoses without protective cover for acetylene for oxygene and other not combustible gases for gas welding cutting and allied processes 《用于乙炔,氧气和其他的不可燃气体的,用于气体焊接,切割.pdf ONORM M 7870-1982 Hoses without protective cover for acetylene for oxygene and other not combustible gases for gas welding cutting and allied processes 《用于乙炔,氧气和其他的不可燃气体的,用于气体焊接,切割.pdf
  • ONORM M 7871-1983 Hose connections- and couplers for equipments for welding cutting and allied processes《用于焊接,切割及相关工艺的设备的软管连接和耦合器》.pdf ONORM M 7871-1983 Hose connections- and couplers for equipments for welding cutting and allied processes《用于焊接,切割及相关工艺的设备的软管连接和耦合器》.pdf
  • ONORM M 7875-1989 Regulators for gas cy linders for gase s used for welding eutting and related processes requirements testing marking of conformity《用于焊接,切割及相关工艺的气体汽缸的调节器 要求,测试,合格标.pdf ONORM M 7875-1989 Regulators for gas cy linders for gase s used for welding eutting and related processes requirements testing marking of conformity《用于焊接,切割及相关工艺的气体汽缸的调节器 要求,测试,合格标.pdf
  • ONORM M 7876-1987 Regulators for central gas supply units usedfor welding cutting and allied processes requirements testing marking of conformity《用于焊接,切割及相关工艺的中心供气装置的调节器 要求,测试,合格标识.pdf ONORM M 7876-1987 Regulators for central gas supply units usedfor welding cutting and allied processes requirements testing marking of conformity《用于焊接,切割及相关工艺的中心供气装置的调节器 要求,测试,合格标识.pdf
  • ONORM M 7877-1988 Hand-operated shut-off valves for welding cutting and allied processes types of construction safety requirements testing marking of conformity《焊接 切割及类似工艺用的手动开关阀 建.pdf ONORM M 7877-1988 Hand-operated shut-off valves for welding cutting and allied processes types of construction safety requirements testing marking of conformity《焊接 切割及类似工艺用的手动开关阀 建.pdf
  • ONORM M 7880-1986 Manual blowpipes for oxy-acetylene welding and cutting types of construction terms requirements marking quality-assurance marking of conformity《氧 乙炔焊接和切割的人工喷焊器 建造.pdf ONORM M 7880-1986 Manual blowpipes for oxy-acetylene welding and cutting types of construction terms requirements marking quality-assurance marking of conformity《氧 乙炔焊接和切割的人工喷焊器 建造.pdf
  • ONORM M 7881-1986 Manual blowpipes for oxy-acetylene welding and cutting testing《氧 乙炔焊接和切割的人工喷焊器 测试》.pdf ONORM M 7881-1986 Manual blowpipes for oxy-acetylene welding and cutting testing《氧 乙炔焊接和切割的人工喷焊器 测试》.pdf
  • 相关搜索

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

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