Prog 117: More Number Puzzles

///Name: Ilana Levy
///Period: 5
///Program Name: More Number Puzzles
///File Name: moreNumPuzzles.java
///Date Finished: 10/5/2015

import java.util.Scanner;

public class moreNumPuzzles
{
        public static void main( String[] args )
        {
                Scanner keyboard = new Scanner( System.in );
                int choice;
                do
                {
                        System.out.println( "1) Find two digit numbers <= 56 with sums of digits >10\n2) Find two digit number minus number reversed which equals sum of digits\n3) Quit" );
                        System.out.println("\n");
                        choice = keyboard.nextInt();
                        
                        if (choice == 1 )
                        {
                            for ( int x = 10; x <= 50; x = x + 10 )
                            {
                                    for ( int y = 1; y <= 9; y++ )
                                    {
                                            if ((x + y )<= 56 )
                                            {
                                                int z = x/10 + y;
                                                if ( z > 10 )
                                                System.out.println( x +  y );
                                            }
                                    }
                            }
                        }
                        else if ( choice == 2 )
                        {
                            for ( int a = 1; a <= 9; a = a + 1 )
                            {
                                    for ( int b = 1; b <= 9; b++ )
                                    {
                                        int c = a + b, d = a - b, e = b - a;
                                        if ( b > a )
                                        {
                                            d = d - 1;
                                            e = e + 10;
                                            if ( (d + e) == c )
                                                System.out.println( b + "" + a );
                                        }
                                        else 
                                        {
                                            if ( (d + e) == c )
                                                System.out.println( a + "" + b );
                                        }
                                    }
                            }
                        } 
                }while (choice != 3);
        }
}