First of all, yes this is homework and I already solved the problem, which required the programmer to write a program to determine if the digits in a three-digit number supplied by a user are all odd, all even, or mixed. My question is the following: Is there a way to make this code look prettier? I'm a chick and I'm new to Java. I want to keep my program functional, but I would also like it to look nice as well. Any suggestions would be greatly appreciated.
import java.util.Scanner;//program uses class Scanner public class Exe_Two { //main method begins execution of Java application public static void main( String[] args) { //create a Scanner to obtain input from the command window Scanner in =new Scanner(System.in); System.out.println( "Input a three-digit number:");//prompt int num =in.nextInt(); //read number from user Boolean number1=false; Boolean number2=false; Boolean number3=false; number1 = num % 2 == 0; number2 = num % 2 == 0; num/=10; number3 = num % 2 == 0; if(number1&&number2&&number3==Boolean.TRUE) System.out.println("This number contains all even digits."); else if(number1==Boolean.TRUE||number2==Boolean.TRUE||number3==Boolean.TRUE) System.out.println("This number contains both odd and even digits."); else System.out.println("This number contains all odd digits."); in.close(); } // end method main } // end class Exe_Two