Question: Add the following accessor method to the Point class: public int quadrant() Returns which quadrant of the x/y plane the current Point object falls in.

Add the following accessor method to the Point class:

public int quadrant()

Returns which quadrant of the x/y plane the current Point object falls in. Quadrant 1 contains all points whose x and y values are both positive. Quadrant 2 contains all points with negative x but positive y. Quadrant 3 contains all points with negative x and y values. Quadrant 4 contains all points with positive x but negative y. If the point lies directly on the and/or axis, return 0.

Step by Step Solution

3.37 Rating (181 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public int quadrant if x 0 y 0 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!