Artem H.

asked • 05/07/21

 Is the following TRUE? Given the following quadrant method below: This method returns which quadrant of the x/y plane this Point object falls in?

Given the following quadrant  method to the Point class:

public class Point {
private int x;
private int y;

public int quadrant(){

 if (x >0) return 1

 if (x<0) return 2;

 if (y>0) return 3;

 if (y<0) return 4;

}}

 

This method returns which quadrant of the x/y plane this 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 x and/or y axis, return 0.


Is this True?

1 Expert Answer

By:

Patrick B. answered • 05/08/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.