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
Q19: Consider the following statement: System.out.println("1 big bad
Q20: Consider having three String variables a, b,
Q21: Assume that x is a double that
Q23: Which of the following would return the
Q23: Which library package would you import to
Q25: Consider the following paint method and answer
Q26: For the following questions, refer to the
Q27: Consider the double value likelihood = 0.013885.
Q28: In order to create a constant, you
Q29: Consider the following paint method and answer
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents