Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Quadratics
- {
- public static void main(String [] args)
- {
- Scanner pikachu = new Scanner(System.in);
- System.out.println("This program tells you the quadrant that your coordinate plane is located at");
- System.out.print("Input your x coordinate");
- int x = pikachu.nextInt();
- System.out.print("Input your y coordinate");
- int y = pikachu.nextInt();
- if (x == 0) {
- if (y == 0) {
- System.out.println("The point lie on the origin");
- } else {
- System.out.println("The point lie on the y-axis");
- }
- } else if (x > 0) {
- if (y == 0) {
- System.out.println("The point lie on the x-axis");
- } else if (y > 0) {
- System.out.println("The point lie in 1st Quadrant");
- } else {
- System.out.println("The point lie in 4th Quadrant");
- }
- } else {
- if (y == 0) {
- System.out.println("The point lie on the x-axis");
- } else if (y > 0) {
- System.out.println("The point lie in 2nd Quadrant");
- } else {
- System.out.println("The point lie in 3rd Quadrant");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment