Question: ***JAVA ONLY*** Chapter 3 Selections 1. What is 10.10.10.10.10.1==0.5 ? a. true b. false c. There is no guarantee that 10.10.10.10.10.1==0.5 is true. 2. In

 ***JAVA ONLY*** Chapter 3 Selections 1. What is 10.10.10.10.10.1==0.5 ? a.

true b. false c. There is no guarantee that 10.10.10.10.10.1==0.5 is true.

2. In Java, the word true is a. a Java keyword b.

a Boolean literal c. same as value 1 d. same as value

0 3. Which of the following code displays the area of a

circle if the radius is positive? a. if (radius !=0) System.out.println(radius radius

3.14159 ); b. if (radius >=0 ) System.out.println(radius * radius 3.14159 );

c. if (radius >0 ) System.out.println(radius radius 3.14159 ); d. if (radius

***JAVA ONLY***

Chapter 3 Selections 1. What is 10.10.10.10.10.1==0.5 ? a. true b. false c. There is no guarantee that 10.10.10.10.10.1==0.5 is true. 2. In Java, the word true is a. a Java keyword b. a Boolean literal c. same as value 1 d. same as value 0 3. Which of the following code displays the area of a circle if the radius is positive? a. if (radius !=0) System.out.println(radius radius 3.14159 ); b. if (radius >=0 ) System.out.println(radius * radius 3.14159 ); c. if (radius >0 ) System.out.println(radius radius 3.14159 ); d. if (radius 3000 ) \{ 5ystem.out.printin("Income is greater than 3000 ); \} else if (income >4000 ) \{ System.out.printin("Income is greater than 4000 ); \} a. no output b. Income is greater than 3000 c. Income is greater than 3000 followed by Income is greater than 4000 d. Income is greater than 4000 e. Income is greater than 4000 followed by Income is greater than 3000 6. The following code displays double temperature =50; if (temperature >=100 ) System.out.println("too hot"); else if (temperature 0) if (y>0) System.out.printin(" x>0 and y>0 "); else if (z>0) System.out.println(" x0 "); a. x>0 and y>0; b. x0; c. x=16 ) System.out.printin("Can get a driver's license"): II: if ( age =16 ) System.out.printin("Can get a driver's license"): IV: if (age >16 ) System.out.printin("Can get a driver's license"); else if (age =16 ) System.out.printin("Can get a driver's license "); 3. 1 b. II c. III d. IV 15. The method immediately terminates the program. a. System.terminate(0); b. System.halt(0); c. System.exit(0); d. System.quit(0); e. System.stop(0): 16. Which of the Boolean expressions below is incorrect? a. (true) \&\& (3=>4) b. I(x>0)&&(x>0) c. (x>0)(x1))(x1))&&(xx>100)(x=4, which of the following is true? a. x>=4 \& \& x=4x=4 \& \& x=4xy \& \& xyx=yx10)&&(x++>10). a. 9 b. 10 c. 11 22. Which of the following are so called short-circuit operators? a. \&\& b. \& c. || d. 23. What is y after the following switch statement is executed? int x=3 int y=4; switch (x+3){ case 6:y=0 case 7:y=1 default: y+=1; \} a. 1 b. 2 c. 3 d. 4 e. 0 24. Analyze the following program fragment: int x; double d=1.5; switch (d){ case 1.0:x=1; case 1.5:x=2; case 2.0:x=3; \} a. The program has a compile error because the required break statement is missing in the switch statement. b. The program has a compile error because the required default case is missing in the switch statement. c. The switch control variable cannot be double. d. No errors. 25. What is y after the following statement is executed? x=0y=(x>b==b>a; System.out.printin((even ? "true" : "false")); a. true b. false c. nothing d. true false 28. What is y displayed in the following code? public class Test 1 f public static void main(String[] args) \{ int x=3; int y=x+= Math.pow (2,x); System.out.printin(" y is " + y); \} \} a. y is 0 b. y is 1 c. y is 11 d. The program has a compile error 29. Which of the following operators are right-associative. a. * b. + (binary + ) c. %= d. \&\& e. = 30. Which of the following statements are true? a. (x>0 \& \& x0) \& \& (x0x0)(x0x0(x0x0x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!