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 code*(10pts)
Details explaining how your code works
*Include Project Report*(5pts)
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 (5pts)
Abstraction, Encapsulation, Inheritance, and Polymorphism
Program uses game data provided via input prior to start (5pts)
name, row/column count, fort count, and specials per player
Game consists of 3 possible players (2 CPU and 1 User)(5pts)
User can select an opponent each game (5pts)
Board contains forts randomly added (10pts)
Player information including the following are displayed (5pts)
Board, Fort count, and Forts conquered by the player.
Each player can select a new position on the opposing player's board (5pts)
Each player can implement at least 1 special move (5pts)
Specials are limited based on user input (5pts)
Fort count decreases by 1 after special is used (5pts)
Specials cannot be used when fort count is 1(5pts)
Both the user and cpu can win the game (5pts)
The following specials are implemented into the game:
Scatter (5pts)
Random Scatter (5pts)
Precision (5pts)
Random Precision (10pts)
Linear (10pts) Board class must be include and is as follows: /**
* Constructor
* Initializes board dimensions and forts
*/
Board::Board(int count, int r, int c)
{
fortCount = count;
rows = r;
cols = c;
//Initialize number of rows
board = new string*[r];
for(int i =0; i r; i++)
{
//Initialize number of columns for each row
board[i]= new string[c];
}
// Generate Forts onto board
this->GenerateForts();
}
/**
* Populates the board with forts
*/
void Board::GenerateForts()
{
// Assign a "*" to each element of the board
for(int row =0; row rows; row++)
{
for(int col =0; col cols; col++)
{
board[row][col]="*";
}
}
/** 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[0][0]="1";
board[1][1]="2";
board[2][2]="3";
board[3][3]="4";
board[4][4]="5";
}
/**
* Displays the board with forts hidden
*/
void Board::DisplayBoard()
{
for(int row =0; row this->GetRows(); row++)
{
for(int col =0; col this->GetCols(); col++)
{
// Check if element is a number or Fort. If so display a "*" instead to hide it
if (board[row][col]!="*" && board[row][col]!="x" && board[row][col]!="O")
{
cout setw(3)"*" ;
}
// Otherwise display whatever value is stored there
else
{
cout setw(3) board[row][col] ;
}
}
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
for(int row =0; row this->GetRows(); row++)
{
for(int col =0; col this->GetCols(); col++)
{
cout setw(3) board[row][col] ;
}
cout endl;
}
cout endl;
}
/**
* Accessors / Mutators
*/
string Board::GetBoard(int row, int col)
{
return board[row][col];
}
void Board::SetBoard(int row, int col, string value)
{
board[row][col]= value;
}
int Board::GetFortCount()
{
return fortCount;
}
void Board::SetFortCount(int f)
{
fortCount = f;
}
int Board::GetRows()
{
return rows;
}
void Board::SetRows(int r)
{
rows = r;
}
int Board::GetCols()
{
return cols;
}
void Board::SetCols(int c)
{
cols = c;
} Use the attached picture to write the code for each special move and implement all of the players with their specials
C + + Program! Submit . h and . cpp files with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!