Write a C++ program which generates and displays a random walk across a grid. A 2- dimensional array of characters will be used for this grid. The cells visited by the walk will be labeled by capital letters with A being the first cell, B the cell moved to from A, and so on, ending either when Z is reached or when it is not possible to move to another cell. The following libraries, constant definition, and type definition are needed in the program: #include #include // for srand and rand #include // for time using namespace std; const int SIZE = 10; typedef char Grid[SIZE][SIZE] The grid must be set to have all its elements be the character ’.’ before the walk is begun. The program must contain the following function prototypes, the main function, and the function definitions for all the other functions: // Function prototypes bool can_move_up(int i, int j, Grid walk); bool can_move_down(int i, int j, Grid walk); bool can_move_left(int i, int j, Grid walk); bool can_move_right(int i, int j, Grid walk); void init_array(Grid walk); void generate_random_walk(Grid walk); void print_array(Grid walk); int main(void) { Grid walk; // the grid in which the random walk occurs srand((unsigned) time(NULL)); init_array(walk); generate_random_walk(walk); print_array(walk); return 0; } The four functions can_move _* must return whether or not it is possible to move in the particular direction in the grid. For example, a function call like if (can_move_up(i, j, walk)) could be used to determine whether or not it is possible to move up. The rule for a move being possible is that if it doesn’t go outside of the grid and isn’t already part of the walk, then that move is possible. The function init_array must set all characters in the grid to ’.’ The function generate_random_walk must modify the cells of grid by changing ones that are part of the walk to letters. The function print_array must print the resulting grid in the form shown in the sample run below. In the function generate_random_walk, at each step of the walk, randomly select one of the 4 directions and try to move in that direction. If that move isn’t available, try the other moves in turn until one is possible. If all 4 directions are blocked, the walk must terminate, and the program must continue and print out the walk. To select one of the 4 directions randomly, use the expression: rand() % 4 The function rand returns an integer, and finding the remainder of this integer divided by 4 results in getting one of the numbers 0, 1, 2, or 3. Use these 4 numbers to represent the 4 directions up, down, left and right. The call to the function srand from the main function seeds the pseudo-random number generator used by rand so that different sequences of numbers will be generated by calls to rand each time the program is run. Solution #include //input output functions in C++ #include //rand() and srand() functions #include //time() function for creating seed #include #include // for srand and rand #inclu.