Solved

Example Code Ch 02-2

Question 56

Multiple Choice

Example Code Ch 02-2
import java.util.Scanner;
public class Questions33_34
{
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) ;
}
}
-Refer to Example Code Ch 02-2. This code computes


A) The correct average of x, y, and z as a double
B) The correct average of x, y, and z as an int
C) The average of x, y, and z as a double but the result may not be accurate
D) The sum of x, y, and z as an int
E) The remainder of the sum of x, y, and z divided by 3

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents