import java.util.Scanner;
public class SomeProgram {
5. (12 points) Complete the following program as indicated by the comments:
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int n1, n2;
//declare more variables if necessary
System.out.print("Enter two integers: ");
n1 = console.nextInt();
n2 = console.nextInt();
n1 = Math.abs(n1);
n2 = Math.abs(n2);
/* Math.abs() returns the absolute value, so both n1
and n2 are greater than or equal to 0 */
//Calculate and print the result of n1 divided by n2 if the user input is valid.
//Otherwise, print an error message.
if (n2 != 0) {
System.out.print("n1 divided by n2\n between " + n1 / n2 + " and ");
} else {
System.out.println("n1 divided by n2 is undefined");
}
//Print a message to indicate whether or not n1 is a factor of n2
if (n2 % n1 == 0) {
System.out.println("n Number n1 is a factor of n2");
} else if (n2 % n1 != 0) {
System.out.println("n Number n1 is not a factor of n2");
}
//Swap the values of n1 and n2
if (n1 > n2) {
int t;
t = n1;
n1 = n2;
n2 = t;
}
//Use a while loop to print all the numbers between 100 to 1 (large to small)
int x = 100, y = 1;
int sum = 0;
int count = 0;
while (x >= y) {
System.out.println(x + " ");
}