Question: Java. just want to see if im on the right track. Thanks! public enum Quad{ // An enumeration which models the 4 quadrants of the
Java. just want to see if im on the right track. Thanks! public enum Quad{ // An enumeration which models the 4 quadrants of the 2D Cartesian // plane. It has exactly four elements: Q1, Q2, Q3, Q4. It is likely // that giving each some fields will make the implementation easier. // A private constructor is also useful. public boolean xPositive(); // true if x-coordinates are positive in the quadrant, false otherwise public boolean yPositive(); // true if y-coordinates are positive in the quadrant, false otherwise public String signPair(); // Return a String which represents the signs of the coordinates in // the Quadrant as // (+,+) for Q1 // (-,+) for Q2 // (-,-) for Q3 // (+,-) for Q4 public Quad flippingX(); // Return the Quadrant that would result from flipping the sign (pos // to neg or neg to pos) of the x-coordinate in this Quadrant.. public static Quad fromInts(int x, int y); // Given two integers, determine return the quadrant in which they // reside. If either x or y is 0, return one of the valid quadrants // it might be assigned to (this case is not tested). public static void main(String [] args); // Accept an arbitrary number of command line arguments. Adjacent // pairs of arguments are treated as (x,y) coordinates. Print the // quadrant in which the pair resides along with the signPair(). If // an odd number of arguments is given, ignore the last // argument. Any argument that cannot be converted to an integer // should raise an exception on encountering it. } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
