So, the assignment is basically putting the code where it says to put the code in the skeleton program. There should only be code input in the files grid.cpp and main.cpp.
For this project, you will be using everything we have discussed so far about programming in C++ to implement a game called "Sea Battle" . This is a two-player version of the popular strategy game, Battleship. This game is played on four 10x10 grids, two for each player. Each player is given: a primary grid , a tracking grid , and a fleet of nine ships , deployed at random positions and orientations within their respective primary grids. Depending on their size, the ships occupy two to five grid squares each, and they must be deployed in such a way that all of the ships fit within the bounds of the grid without overlapping (that is, without extending below the last row of the grid or "wrapping" from the right side of one row to the left side of the following row). The players take turns firing shots at target squares within their opponent's primary grid, one shot per turn, recording hits and misses within their respective tracking grids. The object of the game is to sink every ship in the opponent's fleet; to sink a ship, it is necessary to hit every square that it occupies. The first player to destroy their opponent's entire fleet, by sinking every ship in it, is the winner. At the start of a game, both players launch the "Sea Battle" program on their own workstations, so that neither player can see their opponent's screen. After agreeing between them which player is to be Player 1 and which is to be Player 2, both players enter their respective player numbers, as well as the player number which will be given the first turn. The program then: creates a primary grid and tracking grid for each player, randomly populates the primary grid with each player's fleet of ships, and prints the contents of both grids to the screen. T he attacking player is asked to select the coordinates of a target square, which they then announce to their opponent. The coordinates are entered by both players; the target square is then marked on the tracking grid of the attacking player (that is, the player making the shot), and on the primary grid of the opponent (that is, the player receiving the shot). The opponent announces to the attacking player whether the shot was a " miss " (the target square was not occupied by any ship), a " hit " (the target square was occupied by a ship), or a " sink " (the target square was occupied by the last remaining square of a now-sunken ship). Both players enter this information at their workstations so that their fleet counts are kept "in sync" and up to date. The players then reverse their roles on the next turn, and continue exchanging shots until all of the ships in one player's fleet have been sunk. The initial complement of ships in each player's fleet is as follows: Quantity Ship Type # of Squares Displayed Code 1 Aircraft Carrier 5 A 1 Battleship 4 B 2 Cruiser 3 C 2 Submarine 3 S 3 Patrol Boat 2 P The squares occupied by each ship are indicated by their respective letter codes within the primary grid. As the players take their shots, the target squares are marked with a "/" (a "splash mark") if the shot was a miss , or an "X" (a "bang mark") if the shot resulted in a hit or a sink . See the example shown below, which depicts the output from the first few turns of a typical game. The player's input is shown in bold. Welcome to ... _____ _________ ____ ___ ______________ ________ / ___// ____/ | / __ )/ |/_ __/_ __/ / / ____/ / \__ \/ __/ / /| | / __ / /| | / / / / / / / __/ / / ___/ / /___/ ___ | / /_/ / ___ |/ / / / / /___/ /___/_/ /____/_____/_/ |_| /_____/_/ |_/_/ /_/ /_____/_____(_) Will you play as Player (1) or as Player (2)? 1 Which player will take the first turn (1/2)? 1 PRIMARY A B C D E F G H I J 1 - - - - - - - - - - 2 - [C][C][C] - [S][S][S] - - 3 [P][P] - - - - - - - - 4 - - - - - - - - - - 5 - - - - [P][P][B] - - - 6 - - - [C] - - [B] - - - 7 - - - [C] - - [B] - - [P] 8 - - - [C] - - [B] - - [P] 9 - - - - - - [S][S][S] - 10 - [A][A][A][A][A] - - - - TRACKING A B C D E F G H I J 1 - - - - - - - - - - 2 - - - - - - - - - - 3 - - - - - - - - - - 4 - - - - - - - - - - 5 - - - - - - - - - - 6 - - - - - - - - - - 7 - - - - - - - - - - 8 - - - - - - - - - - 9 - - - - - - - - - - 10 - - - - - - - - - - Player: 9, Opponent: 9. Choose Your Target (in tracking grid): E5 Was this a (M)iss, a (H)it, or a (S)ink? m PRIMARY A B C D E F G H I J 1 - - - - - - - - - - 2 - [C][C][C] - [S][S][S] - - 3 [P][P] - - - - - - - - 4 - - - - - - - - - - 5 - - - - [P][P][B] - - - 6 - - - [C] - - [B] - - - 7 - - - [C] - - [B] - - [P] 8 - - - [C] - - [B] - - [P] 9 - - - - - - [S][S][S] - 10 - [A][A][A][A][A] - - - - TRACKING A B C D E F G H I J 1 - - - - - - - - - - 2 - - - - - - - - - - 3 - - - - - - - - - - 4 - - - - - - - - - - 5 - - - - / - - - - -