Multiple Choice
For the following questions, refer to the class defined below:
import java.util.Scanner;
public class Questions
{
public static void main(String[ ] args)
{
int x, y, z;
double average;
Scanner scan = new Scanner(System.in) ;
System.out.println("Enter an integer value") ;
x = scan.nextInt( ) ;
System.out.println("Enter another integer value") ;
y = scan.nextInt( ) ;
System.out.println("Enter a third integer value") ;
z = scan.nextInt( ) ;
average = (x + y + z) / 3;
System.out.println("The result of my calculation is " + average) ;
}
}
-What is output if x = 0, y = 1 and z = 1?
A) 0
B) 0.0
C) 0.6666666666666666
D) 0.6666666666666667
E) 0.67
Correct Answer:

Verified
Correct Answer:
Verified
Q11: How many ways are there to test
Q29: A variable of type boolean will store
Q34: Use the following class definition to answer
Q35: If String a = "ABCD" and String
Q36: Java is a strongly typed language. What
Q37: If x is the String "Hi There",
Q38: An employer has decided to award a
Q41: If a, b, and c are int
Q42: As presented in the Software Failure, the
Q43: Using getCurrencyInstance( ) formats a variable, automatically