Hello, all. Attached is a simple (for most) program that I'm working on.

All 6 Replies

Here is the code I've produced so far:

``````package quadrant;

import java.util.Scanner;

{
public static int x1;
public static int y1;
public static int x2;
public static int y2;

public static int Coordinate1Quadrant(int x1, int y1)
{

if (x1 > 0 && y1 > 0)
{
}

else if (x1 < 0 && y1 > 0)
{
}

else if (x1 > 0 && y1 > 0)
{
}

else if (x1 > 0 && y1 < 0)
{
}

}

public int Coordinate2Quadrant(int x2, int y2)
{

if (x2 > 0 && y2 > 0)
{
}

else if (x2 < 0 && y2 > 0)
{
}

else if (x2 > 0 && y2 > 0)
{
}

else if (x2 > 0 && y2 < 0)
{
}

}

/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Please enter a value for x1: ");
x1 = input.nextInt();
System.out.print("Please enter a value for y1: ");
y1 = input.nextInt();
System.out.print("Please enter a value for x2: ");
x2 = input.nextInt();
System.out.print("Please enter a value for y2: ");
y2 = input.nextInt();

{
System.out.print("These coordinates are in the same quadrant.");
}

{
}
{
System.out.print("These coordinates are in opposite quadrants.");
}

}
}
``````

I'm getting a lot of errors with this, and I'm pretty sure it stems with the methods I set up (Coordinate1Quadrant and Coordinate2Quadrant). I'm not profecient with them whatsoever. If someone could please show me the right direction I'd grealy appreciate it.

what sort of errors?

you need to declare the variables Coordinate1Quadrant and Coordinate2Quadrant in the main method.

can you tell me the exact error?