题目内容

What will be the values of ans, x, and y after the following statements are executed?执行以下语句后,ans,x和y的值是什么?int ans = 35, x = 50, y =50;if ( x >= y){ans = x + 10;x -=y;} else {ans = y + 10;y += x;}

A. ans = 60, x = 50, y =100
B. ans = 60, x =0, y =50
C. ans = 45, x = 50, y = 0
D. ans = 45, x = 50, y = 50

查看答案
更多问题

What will be the value of bonus after the following code is executed?执行以下代码后,bonus的值是多少?int bonus, sales = 10000;if (sales < 5000)bonus = 200;else if (sales < 7500)bonus = 500;else if (sales < 10000)bonus = 750;else if (sales < 20000)bonus = 1000;elsebonus = 1250;

A. 200
B. 500
C. 750
D. 1000
E. 1250

阅读下面代码if(award== 0) {System.out.println("金奖");}elseif(award> -7) { System.out.println("银奖");}else{System.out.println("铜奖");}若要求打印字符串"铜奖",则变量award的取值范围是_____。()

A. award=0&award<=-7
B. award>0
C. award>-7
D. award<=-7

In most editors, you are indenting by one level each time that you press this key:在大多数编辑器中,每次按此键都会缩进一级:

A. Tab
B. Shift
C. Alt
D. Space

If you prematurely terminate an if statement with a semicolon, the compiler will:如果过早用分号终止if语句,则编译器将:

A. Not display an error message 不显示错误信息
B. Assume you are placing a null statement there 假设您在此处放置一个空语句
C. All of the above 以上都是
D. None of the above 以上都不是

答案查题题库