Advertisement
Guest User

Problem 3. Points inside a Figure

a guest
May 15th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 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 input = new Scanner(System.in);
  8. //Point
  9. System.out.print("Enter point: ");
  10. float x = input.nextFloat();
  11. float y = input.nextFloat();
  12.  
  13. //Check
  14. if ((x>=12.5)&&(x<=22.5)&&(y>=6)&&(y<=13.5)){
  15. if (!((x>=17.5)&&(x<=20)&&(y>=8.5))) {
  16. System.out.print("Inside");
  17. }
  18. else {
  19. System.out.print("Outside");
  20. }
  21. }
  22. else {
  23. System.out.print("Outside");
  24. }
  25.  
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement