Add the following accessor method to the Point class: public int quadrant() Returns which quadrant of the x/y plane the

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. 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.

This problem has been solved!


Do you need an answer to a question different from the above? Ask your question!

Step by Step Answer:

Related Book For  answer-question
Question Details
Chapter # 8- Object-Oriented Programming
Section: Exercises
Problem: 1
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes. * Average response time.
Question Posted: December 04, 2020 00:00:16