Assignemnt #119 and Number Puzzles IV: A New Hope

Code

/// Name: Kyle Ivy
/// Period: 5
/// Program Name: aNewHope.java
/// File Name: aNewHope
/// Date Finished: 4/20/2016

    public class aNewHope
    {
        public static void main( String[] args )
        {
            for ( int a = 0; a<45; a++ ){
                for ( int b=0; b<45; b++){
                    for ( int c=0; c<45; c++ ){
                        for ( int d=0; d<45; d++){
                            if ( ( (a+2)==(b-2) && (b-2)==(c*2) && (c*2)==(d/2) ) && ( (a+b+c+d)==45 ) ){
                                System.out.println( a + " " + b + " " + c + " " + d );
                            }
                        }
                    }
                }
            }
        }
    } 
    

prog119.PNG

Assignment 1