Design a Java application that prompts the user to input the
Solution
import java.util.Scanner;
 public class Ex1_1{
public static void main(String []args){
 Scanner sc=new Scanner(System.in);   
 System.out.println(\"Enter the coordinates in cartesian plane\"); //asking for the input from the user
 int x=sc.nextInt(); //storing the x-axis value in x
 int y=sc.nextInt(); //storing the y-axis value in x
 if((x==0 && y!=0)||(y==0 && x!=0)) // condition for determing whether the point is in either x-axis or y-axis
 {
 if(x==0)
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is on the y-axis\");
 else
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is on the x-axis\");
 
 
 }
 else if(x==0&&y==0)
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is the origin\");               // condition for determing whether the point is the origin   
 
 else
 {
 if(x>0 && y>0)
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is in the first quadrant \");   // condition for determing whether the point is in the first quadrant
 else if(x<0 && y>0)
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is in the second quadrant \");   // condition for determing whether the point is in the second quadrant
 else if(x<0 && y<0)
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is in the third quadrant \"); // condition for determing whether the point is in the third quadrant
 else
 System.out.println(\"(\"+x+\",\"+y+\")\"+\" is in the fourth quadrant \"); // condition for determing whether the point is in the fourth quadrant
   
 }
 
 
 }
 }
 /********************output begins *********************/
 Enter the coordinates in cartesian plane
 0   
 0   
 (0,0) is the origin
 Enter the coordinates in cartesian plane
 4   
 0   
 (4,0) is on the x-axis
 Enter the coordinates in cartesian plane
 0   
 -3
 (0,-3) is on the y-axis
 Enter the coordinates in cartesian plane
 -2
 3   
 (-2,3) is in the second quadrant
/********************output ends *********************/
 Please let me know in case you have any doubts.


