1、计算机二级 JAVA-63及答案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序判断 score=89,93,60,59,78,91中是否所有人的成绩都超过了 80分,如果有人没有超过,则显示提示信息“有人未超过 80分!”,否则显示“全部超过 80分!” public class exam_58 public static void main(String args) int score=89,93,60,59,78,91; int i=0; while(_) if(scorei80) _; i+; if(_) System.o
2、ut.println(“有人未超过 80分!“); else System.out.println(“全部超过 80分!“); (分数:30.00)_2.本程序分别输出字符串:a/b、“c/d“和e/f。 public class exam_59 public static void main(String args) String str=new String(); _; System.out.println(str); _; System.out.println(str); _; System.out.println(str); (分数:30.00)_3.本程序将数组中 arr=5,6,3
3、,7,9,1)的各个元素按下标的逆序输出。 public clas s exam_60 public static void main(String args) int arr=5,6,3,7,9,1; _; n=_; while(n=0) System.out.print(arrn+“ “); _; (分数:40.00)_计算机二级 JAVA-63答案解析(总分:100.00,做题时间:90 分钟)一、B基本操作题/B(总题数:3,分数:100.00)1.本程序判断 score=89,93,60,59,78,91中是否所有人的成绩都超过了 80分,如果有人没有超过,则显示提示信息“有人未超过
4、 80分!”,否则显示“全部超过 80分!” public class exam_58 public static void main(String args) int score=89,93,60,59,78,91; int i=0; while(_) if(scorei80) _; i+; if(_) System.out.println(“有人未超过 80分!“); else System.out.println(“全部超过 80分!“); (分数:30.00)_正确答案:(iscore.length break iscore.length)解析:2.本程序分别输出字符串:a/b、“c/
5、d“和e/f。 public class exam_59 public static void main(String args) String str=new String(); _; System.out.println(str); _; System.out.println(str); _; System.out.println(str); (分数:30.00)_正确答案:(str=“a/b“ str=“c/d“ str=“/e/f/“)解析:3.本程序将数组中 arr=5,6,3,7,9,1)的各个元素按下标的逆序输出。 public clas s exam_60 public static void main(String args) int arr=5,6,3,7,9,1; _; n=_; while(n=0) System.out.print(arrn+“ “); _; (分数:40.00)_正确答案:(int n arr.length-1 n-(或 n=n-1或 n-=1)解析: