subject

Fields & Methods Q1, Q2, Q3, Q4
There are four elements of the Quadrant enumeration: Q1, Q2, Q3, Q4. Ensure that these are all present and no other exist.
public boolean xPositive();
public boolean yPositive();
These two simple accessors indicate whether the coordinates of the Quadrant are positive or negative. In order to make this functionality easy, it is helpful to define some private fields and a private constructor.
public String signPair()
Quadrants can return a pretty string which indicates the sign of the x and y values they contain. These are the strings
(+,+) for Q1
(-,+) for Q2
(-,-) for Q3
(+,-) for Q4
public Quadrant flipX();
For a coordinate (x, y) in this Quadrant, method flipX() should return the Quadrant that would the coordinate (-x, y) would belong to.
public static Quadrant fromInts(int x, int y)
This function returns the Quadrant in which the pair (x, y) would fall. As noted earlier, if x or y are 0, multiple quadrants apply. Return any valid choice in such cases but know that this case will not be tested in the test cases.
Welcome to DrJava.
> Quadrant q = Quadrant. fromInts(1,4);
> q Q1
> q = Quadrant. fromInts(11,-34);
> q Q4

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
What is the most important for you to choose before you build a network?
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
You are to write a series of steps that anyone could follow to solve the following three problems: 1. even odd a. assume that someone tells you a number (an integer number) b. you hear the number and respond with the word even or odd 2. average a. assume that someone tells you between 3 and 5 numeric values. b. you hear the numbers and respond with the average is some number 3. dog or cat a. explain to a child the differences between a dog and a cat. b. your explanation could be used by a child or anyone to distinguish the difference between a dog and a cat
Answers: 1
question
Computers and Technology, 25.06.2019 12:30
What is the purpose of lookup tables in spreadsheet software
Answers: 1
You know the right answer?
Fields & Methods Q1, Q2, Q3, Q4
There are four elements of the Quadrant enumeration: Q1,...
Questions
question
Mathematics, 29.01.2020 21:47
question
Biology, 29.01.2020 21:47
Questions on the website: 13722360