Advertisement
Guest User

Points inside a Figure

a guest
May 12th, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class PointsInsideFigure {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner sc = new Scanner(System.in);
  8.         System.out.println("Enter the coords of point: ");
  9.         double xCoord = Double.parseDouble(sc.next());
  10.         double yCoord = Double.parseDouble(sc.next());
  11.        
  12.         if(xCoord >= 12.5 && xCoord <= 22.5 && yCoord >= 6 && yCoord <= 13.5) {
  13.             if(xCoord > 17.5 && xCoord < 20 && yCoord > 8.5 && yCoord < 13.5)
  14.                 System.out.println("Outside");
  15.             System.out.println("Inside");
  16.         }
  17.         else
  18.             System.out.println("Outside");
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement