Assignment #117 and More Number Puzzles

Code

    /// Name: Lauren Baird
    /// Period: 7
    /// Program Name: More Number Puzzles
    /// File Name: NumberPuzzles2.java
    /// Date Finished: 1/29/2016
    
    import java.util.Scanner;
    
    public class NumberPuzzles2
    {
        public static void main( String[] args )
        {
            Scanner keyboard = new Scanner(System.in);
            
            int choice;
            
            do
            {
                System.out.println();
                System.out.println( "1) Find two digit numbers <= 56 with sums of digits > 10" );
                System.out.println( "2) Find two digit number minus number reversed which equals sum of digits" );
                System.out.println( "3) Quit" );
                System.out.print( "> " );
                choice = keyboard.nextInt();
                
                if ( choice == 1 )
                    one();
                else if ( choice == 2 )
                    two();
                else
                    System.out.println();
                    
                    
            }while ( choice != 3 );
        }
        
        public static void one()
        {
            
            int x, y;
            
            for ( x = 1; x <= 5; x++ )
            {
                for ( y = 0; y <= 9; y++ )
                {
                    int n = ( x * 10 ) + y;
                    
                    if ( x + y > 10 && n <= 56 )
                    {
                        System.out.print( x + "" + y + "  " );
                    }
                }
            }
            System.out.println();
        }
            
        public static void two()
        {
            int a, b;
            
            for ( a = 1; a <= 9; a++ )
            {
                for ( b = 0; b <= 9; b++ )
                {
                    int r = ( a * 10 ) + b;
                    int s = ( b * 10 ) + a;
                    
                    if ( r - s == a + b )
                    {
                        System.out.print( a + "" + b + "  " );
                    }
                }
            }
            System.out.println();
        }
    }  
    

Picture of the output

Assignment #117