A) To write the expression that calculates the answer
B) To understand the problem and its inputs and outputs
C) To do examples by hand that confirm the solution will work
D) To write Java code that can be executed and tested
Correct Answer
verified
Multiple Choice
A) num1 = 4.20 and num2 = 63.0
B) num1 = 4.20 and num2 = 47.0
C) num1 = 42.0 and num2 = 42.0
D) num1 = 42.0 and num2 = 47.0
Correct Answer
verified
Multiple Choice
A) The value inside the variable r will be 0.326
B) The value inside the variable r will be 5.036
C) Variable r has to be defined as an integer because the % operator always returns an integer
D) The initialization of variable r is wrong, because the % operator expects integer values as operands
Correct Answer
verified
Multiple Choice
A) length(str)
B) length.str
C) str.length
D) str.length()
Correct Answer
verified
Multiple Choice
A) abs(x) ;
B) Math.abs(x) ;
C) x.abs() ;
D) x.absolute() ;
Correct Answer
verified
Multiple Choice
A) Compile-time error
B) Run-time error
C) Overflow error
D) Illegal expression
Correct Answer
verified
Multiple Choice
A) The code snippet uses a variable that has not yet been initialized.
B) The code snippet uses a variable that has not been declared.
C) The code snippet attempts to assign a decimal value to an integer variable.
D) The code snippet attempts to assign an integer value to a decimal variable.
Correct Answer
verified
Multiple Choice
A) c = PI * (radius * 2) ;
B) c = PI * Math.pow(2, radius) ;
C) c = PI * Math.pow(radius, 2) ;
D) c = Math.pow(PI * radius, 2) ;
Correct Answer
verified
Multiple Choice
A) integer
B) int
C) Int
D) Float
Correct Answer
verified
Multiple Choice
A) Java is powerful
B) Java + is powerful
C) is powerful
D) Nothing; compile-time error
Correct Answer
verified
Multiple Choice
A) After writing Java code, as a way to summarize the code's algorithm
B) Before writing Java code, as a guide for a general solution
C) After defining Java variables so that the pseudocode and data types make sense
D) Before working out examples by hand in order to guide those examples
Correct Answer
verified
Multiple Choice
A) It checks whether x equals 0.
B) It sets the variable x to zero.
C) It defines a variable named x and initializes it with 0.
D) It is a syntax error because x is not always 0.
Correct Answer
verified
Multiple Choice
A) System.out.println("\\\"///") ;
B) System.out.println("\\\\\\\"///") ;
C) System.out.println("\\\\\\""//////") ;
D) system.out.println("\\\"///") ;
Correct Answer
verified
Multiple Choice
A) The new price is 25
B) The new price is 15
C) The new price is 22.5
D) The new price is 20.0
Correct Answer
verified
Multiple Choice
A) +
B) %
C) &
D) ^
Correct Answer
verified
Multiple Choice
A) System.out.printf("%(5.2e", -123.0) ;
B) System.out.printf("%5.2e", -123.0) ;
C) System.out.printf("^5.2e", -123.0) ;
D) System.out.printf("%5.2E", -123.0) ;
Correct Answer
verified
Multiple Choice
A) The initial value of the counter is 0
B) The initial value of the counter is 1
C) The code will not compile
D) The initial value of the counter is
Correct Answer
verified
Multiple Choice
A) All three statements will return an integer value.
B) Only I will return an integer value.
C) Only I, II will return an integer value.
D) Only I and III will return an integer value.
Correct Answer
verified
Multiple Choice
A) System.out.println("ABCDE\"\\") ;
B) System.out.println("ABCDE"\") ;
C) System.out.println("ABCDE"\) ;
D) System.out.println("ABCDE\"\") ;
Correct Answer
verified
Multiple Choice
A) Only IV is a valid Java variable name.
B) Only I and IV are valid Java variable names.
C) Only I, IV, and V are valid Java variable names.
D) Only III, IV, and V are valid Java variable names.
Correct Answer
verified
Showing 81 - 100 of 103
Related Exams