Assignment #75 and Safe Square Root

Code

    ///Name: Tim Gibson
    ///Period: 6
    ///Project Name: Right Triangle Checker
    ///File Name: Right triangle checker.java
    ///Date Finished: 10/26/15
        
    import java.util.Scanner;
    
    public class Triangle
    {
        public static void main ( String[] args )
        {
            Scanner keyboard = new Scanner(System.in);
            
            int a, b, c;
            
            System.out.println( "Enter three integers:" );
            System.out.print( "Side 1: " );
            a = keyboard.nextInt();
            
            System.out.print( "Side 2: " );
            b = keyboard.nextInt();
            
            while ( a > b )
            {
                System.out.println( b + " is smaller than " + a +". Try again." );
                System.out.print( "Side 2: " );
                b = keyboard.nextInt();
            }
            
            System.out.print( "Side 3: " );
            c = keyboard.nextInt();
            
            while ( c < b )
            {
                System.out.println( c + " is smaller than " + b + ". Try again." );
                System.out.print( "Side 3: " );
                c = keyboard.nextInt();
            }
            
            boolean d = ( ( a * a ) + ( b * b ) == ( c * c ) );
                
            System.out.println( "Your three sides are " + a + " " + b + " " + c );
            
            if ( d = true )
                System.out.println( "These sides *do* make a right triangle. Yay!" );
            
            else 
                System.out.println( "NO! These sides do not make a right triangle!" );
        }
    }
        

Picture of the output

Assignment75