Question: Java Test 6) The following code displays ________. double temperature = 50; if (temperature > = 100) System.out.println(too hot); else if (temperature < = 40)
Java Test
6) The following code displays ________. double temperature = 50; if (temperature > = 100) System.out.println("too hot"); else if (temperature < = 40) System.out.println("too cold"); else System.out.println("just right");
A) too cold B) too hot C) too hot too cold just right D) just right
7) 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 < = 0) System.out.println(radius * radius * 3.14159);
8) ________ is the code with natural language mixed with Java code.
A) A flowchart diagram B) Java program C) Pseudocode D) A Java statement
9) Analyze the following code: if (x < 100) && (x > 10) System.out.println("x is between 10 and 100");
A) The statement compiles fine. B) The statement has compile errors because (x<100) & (x > 10) must be enclosed inside parentheses and the println() statement must be put inside a block. C) The statement compiles fine, but has a runtime error. D) The statement has compile errors because (x<100) & (x > 10) must be enclosed inside parentheses.
10) In Java, the word true is ________.
A) same as value 1 B) same as value 0 C) a Boolean literal D) a Java keyword 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
