Java Reference
In-Depth Information
In the following program, number the marked statements to show the order
in which they will execute (the logical order of execution):
import
java.util.*;
26.
public class
Exercise26
{
static
Scanner console =
new
Scanner(System.in);
public static void
main(String[] args)
{
int
num1;
int
num2;
_______ System.out.println("Please enter two integers "
+ "on separate lines";
_______ num1 = console.nextInt();
_______ num2 = console.nextInt();
_______ func (num1, num2);
_______ System.out.println("The two integers are " + num1
+ ", " + num2);
}
public static void
func (
int
val1,
int
val2)
{
int
val3;
int
val4;
_______ val3 = val1 + val2;
_______ val4 = val1 * val2;
_______ System.out.println("The sum and product are " + val3
+ " and " + val4);
}
}
27.
Consider the following program:
import
java.util.*;
public class
Chapter7Ex27
{
static
Scanner console =
new
Scanner(System.in);
public static void
main(String[] args)
{
int
num;
Search WWH ::
Custom Search