Hello everybody, I just started getting a course in Java and have no previous knowledge of the programming language. We have a homework assignment where we have to determine if a given point lies within the bounds of a rectangle based on 4 previous integers (x and y coordinates of point one and two respectively). I've got the "if else" part covered I only don't know how to initialize my variables because those need to be filled in by the program user to get an output of error, inside or outside.
What am I doing wrong/missing?
Thank you so much for your help in advance!
public class Rectangle{ public static void main(String args[]){ int a; int b; int c; int d; int e; int f; // length = c - a // width = d - b if ( a <= c && b >= d ) { //if point 2 is not to the right and below point one System.out.println("error"); } else if ( (b >= e ||e <= d ) && (a >= f || b <= c)) { //determine if 3rd point is in the bounds System.out.println("inside"); } else { System.out.println("outside"); } } }