Course Solutions Uncategorized (Solved) : Method Returns Coordinates Game Battleship Array Declared Two Integers Instead One Would H Q34209297 . . . .

(Solved) : Method Returns Coordinates Game Battleship Array Declared Two Integers Instead One Would H Q34209297 . . . .

 

This method returns the coordinates in a game of Battleship. Why is the array declared with two integers instead of one? It would be very helpful if someone could comment each line of code so I can get a better understanding of what is going on. Thanks.public int[] getCoordinates(String input){ int[] coordinates = new int[2]; String[] strList = input.split(” “); int row = strList[0].charAt(0) – ‘a’; int col = Integer.parseInt(strList[1]); coordinates[0] = row; coordinates[1] = col; return coordinates;}

Expert

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Given Following Dataset Containing Three Blocks Time Date Referenced Matrices 12 00 00 01 Q33298163 . . . .(Solved) : Given Following Dataset Containing Three Blocks Time Date Referenced Matrices 12 00 00 01 Q33298163 . . . .

<p>Given the following dataset containing three blocks of time anddate referenced matrices:</p><p>12:00:00<br/>01-Jan-1977<br/>4.21 6.55 6.78 6.55<br/>9.15 0.35 7.57 -3.34<br/>7.92 8.49 7.43 7.06<br/>9.59 9.33 3.92 0.31<br/>09:10:02<br/>23-Aug-1990<br/>2.76 6.94 4.38 1.86<br/>0.46 3.17 -0.37 4.89<br/>0.97