Question: Write a c++ program!? In this C++ program, you wi start building the software infrastructure that will allow you to play a simplified version of
In this C++ program, you wi start building the software infrastructure that will allow you to play a simplified version of the class game of Minesweeper that will display to the screen. In Homework 6, you will continue the work begun here to finish the development of the game Your program's output should initially call a function to display the department and course number, your name, your EUID, and your e-mail address In the m function, your program will prompt the user to enter the number of mines as an integer between 5 and 10, inclusively, that will be placed in a randomly selected location on the 5-by-5 board used for the game. If the user does not enter a valid response, you will repeat this process until a valid response is entered To start the game, you will display an introductory message, giving details about the game, including the size of the board, the number of number of mines placed on the board, and the objective of the game (i.e., how many squares are needed to be selected without hitting a mine to win). This will be implemented as a function, passing in parameters as needed You shall declare a two-dimensional array in main to represent the 5-by-5 board as an enum type you declare to represent the various values that a square can assume Each square on your board may contain one of the following values (according to the rules of the game) initial value of square not revealed (may or may not contain mine) a mine is present at this location the user selected a square containing a mine the number of mines contained in the immediately adjacent squares The size of the square board should be declared as a constant, but it is up to you whether or not it is a local or global constant You will initialize the board using a function, passing in the two-dimensional array and the size. This function will simply initialize each position on the board to the enumerated type representing the initial value, which is the character You will then assign the number of mines between 5 and 10, inclusively, specified by the user to randomly generated locations on the board using a bool function, passing in the two-dimensional array and the size. This function will generate a random row column position and then attempt to place a mine at that row-column position on the board. Since the row-column position is randomly generated, if the function attempts to place a mine on a square that already contains a mine, the method will return false indicating that the assignment was not successful. If the square, however, does not already contain a mine, then the function will assign a mine to that location by assigning that row-column position with the enumerated type representing the mine and return true, indicative that the assignment was successful. Note that this function attempts to
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
