Question: C + + Program! Submit . h and . cpp files with documentation in a . zip file * Include comments in code * (
C Program! Submit h and cpp files with documentation in a zip file
Include comments in codepts
Details explaining how your code works
Include Project Reportpts
Details how you solved each specification in your program
Something you enjoyed
Something you struggled with
Program Specifications and Correctness Test Cases:
Object oriented methodologies are implemented with separate header and implementation files pts
Abstraction, Encapsulation, Inheritance, and Polymorphism
Program uses game data provided via input prior to start pts
name, rowcolumn count, fort count, and specials per player
Game consists of possible players CPU and Userpts
User can select an opponent each game pts
Board contains forts randomly added pts
Player information including the following are displayed pts
Board, Fort count, and Forts conquered by the player.
Each player can select a new position on the opposing player's board pts
Each player can implement at least special move pts
Specials are limited based on user input pts
Fort count decreases by after special is used pts
Specials cannot be used when fort count is pts
Both the user and cpu can win the game pts
The following specials are implemented into the game:
Scatter pts
Random Scatter pts
Precision pts
Random Precision pts
Linear pts Board class must be include and is as follows:
Constructor
Initializes board dimensions and forts
Board::Boardint count, int r int c
fortCount count;
rows r;
cols c;
Initialize number of rows
board new stringr;
forint i ; i r; i
Initialize number of columns for each row
boardi new stringc;
Generate Forts onto board
thisGenerateForts;
Populates the board with forts
void Board::GenerateForts
Assign a to each element of the board
forint row ; row rows; row
forint col ; col cols; col
boardrowcol;
ADD CODE HERE TO GENERATE FORTS RANDOMLY
Please write correct code here to generate the forts
This is code is for demo only.
Should replace with code to generate forts
board;
board;
board;
board;
board;
Displays the board with forts hidden
void Board::DisplayBoard
forint row ; row thisGetRows; row
forint col ; col thisGetCols; col
Check if element is a number or Fort. If so display a instead to hide it
if boardrowcol && boardrowcolx && boardrowcolO
cout setw ;
Otherwise display whatever value is stored there
else
cout setw boardrowcol ;
cout endl;
cout endl;
Displays the board with forts shown
TEST METHOD use when checking if forts exist
Not needed for final submission
void Board::DisplayTestBoard
Display elements with no hiding
forint row ; row thisGetRows; row
forint col ; col thisGetCols; col
cout setw boardrowcol ;
cout endl;
cout endl;
Accessors Mutators
string Board::GetBoardint row, int col
return boardrowcol;
void Board::SetBoardint row, int col, string value
boardrowcol value;
int Board::GetFortCount
return fortCount;
void Board::SetFortCountint f
fortCount f;
int Board::GetRows
return rows;
void Board::SetRowsint r
rows r;
int Board::GetCols
return cols;
void Board::SetColsint c
cols c;
Use the attached picture to write the code for each special move and implement all of the players with their specials
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
