Unable to create a proper method for a quadrant checker program?

It work like in another programming language. If you wrote return value, you must return some value) class MethodQuad { public static int quadrant(double x, double y) { if(x > 0 && y > 0) return 1; else if(x 0) return 2; else if(x 0) return 4; else return 0; } }.

You're telling the method that it will return a double in its signature line: public static double quadrant(double x, double y) The compiler won't like this since the method is not in fact returning a double (nor should it). I suggest you change that line so that it knows it will return a String instead. You probably know how to do this, right?

Also, in your class, you're declaring answer to be a double variable which doesn't make logical sense: double x, y, answer; What variable type should answer be declared as? Edit You'll also want to post your assignment instructions so we can see exactly what you're supposed to be doing. You could potentially make answer an int and have the method return an int -- if that's what the teacher wanted.So let's see what they told you to do.

1 +1 for guidance; sorry about the intervening reformat. – trashgod Oct 26 at 21:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions