Assignemnt #75

Code

          /// Name: Holden Ganch
          /// Period: 7
          /// Program Name:  seventy fifth Program
          /// File Name: Baby.java
          /// Date Finished: 2/8/2016


    
        
            import java.util.Random;
            import java.util.Scanner;
            
            public class Right
            {
            	public static void main( String[] args )
            	{
            		Scanner keyboard = new Scanner(System.in);
                    Random r = new Random();
                    
                    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 ( b > c )
                    {
                    System.out.println( c + " is smaller than " + b + ". Try again");
                    System.out.print("Side 3: ");
                    c = keyboard.nextInt();
                    }
                    System.out.println("Your three sides are " + a + " " + b + " " + c);
                    
                    int w = ( a * a ) + ( b * b );
                    int z = ( c * c );
                    
                    if ( w == z )
                    {
                        System.out.println("Those sides do make a right triangle");
                    }
                    else
                    {
                        System.out.println("Those sides DON'T make a right triangle");
                    }
                    
                    }
                    }

    
   




    

Picture of the output

Assignment 75