Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
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 (1 point)

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 (1 point)
+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 (1 point)
+5 votes

I used 4 but i returned a boolean

answered by (1 point)
...