/** This program reads the x and y coordinates of a point and determines the quadrant that contains the point. The program displays the x and y coordinates and the quadrant. The quadrant is determined as follows: Quadrant X Y 1 >= 0 >= 0 2 < 0 >= 0 3 < 0 < 0 4 >= 0 < 0 */ import java.util.Scanner; public class Quadrant { public static void main( String[] args ) { // Get the coordintes of the point. Scanner inp = new Scanner(System.in); System.out.print("Enter the x and y coordinates of the point: "); int x = inp.nextInt(); int y = inp.nextInt(); // Determine thw quadrant that contains the point int quadrant; if( x >= 0 ) { if( y >= 0 ) { quadrant = 1; } else { quadrant = 4; } } else { if( y >= 0 ) { quadrant = 2; } else { quadrant = 3; } } // Display the coordinates and the quadrant System.out.println( "The point (" + x + ", " + y + ") is located in quadrant " + quadrant ); } }