Examlex

Solved

Example Code Ch 02-2

question 16

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. What is the output if x = 0, y = 1, and z = 1?


Definitions:

Post-test Loop

A programming construct that executes a block of code at least once and then continues execution based on a specified condition.

Executes

Refers to the process of running or performing the instructions in a program or command.

Continue Statement

In programming, the continue statement skips the current iteration of a loop (for, while, do while) and proceeds with the next iteration.

Loop-continue Test

A test within loop iterations to decide whether to continue with the next iteration or exit the loop.

Related Questions