Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In java please Download this zip file which contains the partially complete Poin

ID: 3596779 • Letter: I

Question

In java please

Download this zip file which contains the partially complete Point and Lab7 classes. If you are using Eclipse, start a new project and add two new classes to that project: Point and Lab7. Copy and the code from the downloaded files and paste them into those two classes If you are using the command-prompt, you can store those two downloaded Java files in whatever location you store your work, and then start editing them. You will need to complete the code in the two classes to finish the lab: 1. Finish the Point class. The class should have: oAn instance variable for the x-coordinate and an instance variable for the y-coordinate, both ints (THIS IS DONE) oA constructor that takes values for the x- and y-coordinates, and initializes the instance variables (THIS IS DONE) A print method, that prints the x-and y-coordinates in the form: (x,y)·(YOU DO THIS) A quadrant method, that returns an int for which quadrant that point is in. In the case of points on an axis, return any quadrant that matches (YOU DO THIS) Quadrant 1: Upper-right .Quadrant 2: Upper-left Quadrant 3: Lower-left Quadrant 4: Lower-right 2. Finish the Lab7 class. Part of this class is already done. In the end, you should: Create two Point objects: one that represents (3,5) and one that represents (-2,7) o Call the print method on each point o Call the quadrant method for each point, and print the result

Explanation / Answer

Both the classes are in this code:(have a look and give ur feedback:)

class point
{
private int x;
private int y;
public point(int newx,int newy)
{
this.x=newx;
this.y=newy;
}

public void print()
{
System.out.println("("+this.x+","+this.y+")");
}

public int quadrant()
{
  
   if(this.x>=0&&this.y>=0)
       return 1;
   else if(this.x<=0&&this.y>=0)
       return 2;
   else if(this.x<=0&&this.y<=0)
       return 3;
   else if(this.x>=0&&this.y<=0)
       return 4;
   else return 0;
  
}
}

class lab7
{
   public static void main(String args[])
   {
       point point1=new point(3,5);
       point point2=new point(-2,7);
       point1.print();
       point2.print();
       int ans=point1.quadrant();
       if(ans==1)
           System.out.println("quadrant 1");
       else if(ans==2)
             System.out.println("quadrant 2");
       else if(ans==3)
             System.out.println("quadrant 3");
       else if(ans==4)
             System.out.println("quadrant 4");
       ans=point2.quadrant();
       if(ans==1)
           System.out.println("quadrant 1");
       else if(ans==2)
             System.out.println("quadrant 2");
       else if(ans==3)
             System.out.println("quadrant 3");
       else if(ans==4)
             System.out.println("quadrant 4");
      
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote