send EDITED code please Battleship.java package part3; public class Battleship { public static void main(String[] args) { // Generate a grid of 15 columns by 10 rows. BattleshipGrid aGrid = new BattleshipGrid(10,10); // Print the grid. aGrid.print(); } } Battleship Grid.java package part3; import java.util.Random; import java.util.Scanner; public class BattleshipGrid { private char[][] grid; private int gridRows, gridColumns; static final int CARRIER_SIZE = 5; static final int BATTLESHIP_SIZE = 4; static final int SUB_SIZE = 3; static final int DESTROYER_SIZE = 3; static final int PATROL_SIZE = 2; static final char CARRIER_CHAR = \'C\'; static final char BATTLESHIP_CHAR = \'B\'; static final char SUB_CHAR = \'S\'; static final char DESTROYER_CHAR = \'D\'; static final char PATROL_CHAR = \'P\'; static final char WATER_CHAR = \'.\'; public BattleshipGrid(int columns, int rows){ gridColumns = columns; gridRows = rows; // Make a two dimensional array of characters as the grid grid = new char[gridColumns][gridRows]; // Clear the grid clear(); // Assign the following ships assignShip(CARRIER_CHAR, CARRIER_SIZE); assignShip(BATTLESHIP_CHAR, BATTLESHIP_SIZE); assignShip(SUB_CHAR, SUB_SIZE); assignShip(DESTROYER_CHAR, DESTROYER_SIZE); assignShip(PATROL_CHAR, PATROL_SIZE); } // Clear the grid public void clear(){ for (int row=0; row < gridRows; row++){ for (int column=0; column < gridColumns; column++) grid[column][row] = WATER_CHAR; } } // Print the grid public void print(){ for (int row=0; row < gridRows; row++){ for (int column=0; column < gridColumns; column++) System.out.print(grid[column][row]); System.out.println(\"\"); } } // Assign a ship horizontally on the grid private boolean assignShipHorizontally(char shipType, int size){ /* 1.2 If horizontal, select a random row to place the ship. o Select a random column position to start “growing� your ship. The column position must be less than 10-size of the ship to ensure the ship will fit. o Look at the next adjacent squares on the grid row to see if they are blank. o If any of the squares are not blank then the ship will not fit so go back to 1.1. o If the ship does fit then mark it with its designation. */ // Select a row and a starting column to place a ship horizontally Random randomGenerator = new Random(); int chosenRow = randomGenerator.nextInt(gridRows); int startingColumn = randomGenerator.nextInt(gridColumns-size); // Count consecutive grid locations horizontally and see if we can accommodate ship int countSegments = 0; for (int c = startingColumn; c < startingColumn+size; c++){ if (grid[c][chosenRow] == WATER_CHAR) countSegments++; } // If ship will fit then allocate the ship horizontally if (countSegments == size){ for (int c = startingColumn; c < startingColumn+size; c++){ grid[c][chosenRow] = shipType; } return true; } return false; } // Assign the ship vertically on the grid private boolean assignShipVertically(char shipType, int size){ /* 1.3 If vertical, select a random column .