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. What is the 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
Q40: What will be the result of the
Q41: Using the various String methods, manipulate a
Q42: Given three int variables with the values
Q43: As presented in the Software Failure section
Q44: Explain what the following statement computes:
int z
Q46: Given two points in an applet represented
Q47: Write an assignment statement to compute the
Q48: How many ways are there to test
Q49: Given four int values, x1, x2, y1,
Q50: Write a set of instructions to prompt
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