willieshi232

Untitled

Oct 18th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Quadratics
  4. {
  5. public static void main(String [] args)
  6. {
  7. Scanner pikachu = new Scanner(System.in);
  8. System.out.println("This program tells you the quadrant that your coordinate plane is located at");
  9. System.out.print("Input your x coordinate");
  10. int x = pikachu.nextInt();
  11. System.out.print("Input your y coordinate");
  12. int y = pikachu.nextInt();
  13. if (x == 0) {
  14. if (y == 0) {
  15. System.out.println("The point lie on the origin");
  16. } else {
  17. System.out.println("The point lie on the y-axis");
  18. }
  19. } else if (x > 0) {
  20. if (y == 0) {
  21. System.out.println("The point lie on the x-axis");
  22. } else if (y > 0) {
  23. System.out.println("The point lie in 1st Quadrant");
  24. } else {
  25. System.out.println("The point lie in 4th Quadrant");
  26. }
  27. } else {
  28. if (y == 0) {
  29. System.out.println("The point lie on the x-axis");
  30. } else if (y > 0) {
  31. System.out.println("The point lie in 2nd Quadrant");
  32. } else {
  33. System.out.println("The point lie in 3rd Quadrant");
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment