Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+22 votes

how many different parameters are needed for the distance method call and also what type would need to be returned a double or an int?

asked in CSC211_Winter2018 by (8 points)

3 Answers

+10 votes

There should be 4 parameters for the distance method. And I think that the distance method should return a double.

answered by (4.2k points)
+10 votes

Just find the distance of the pursuer and the target using their x y coordinates and Pythagorean theorem. Then you can return that value to the main method. In your while loop, as long as that value is smaller or larger than a certain value, then keep redrawing your panels and let the game continue.

answered by (8 points)
+5 votes

I used 4 but i returned a boolean

answered by (8 points)
...