id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

quadrant


Write a method called quadrant that takes a pair of real numbers that indicate the x and y value of a point. This method should return the quadrant that the point lies in. If either the x or y value is 0, the method should return 0.


quadrant(3, 4) → 1
quadrant(-2, 10.5) → 2
quadrant(-4.5, -9) → 3

...Save, Compile, Run (ctrl-enter)

public int quadrant(double x, double y){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy