subject

Write a C++ class to represent the state of a game of Mancala. It will not be responsible for choosing a move, but it will be responsible for making a choosen move. Your program might be used as fllows. #include
#include
using namespace std;

int main()
{
Mancala g;
cout << g;

g. move(4);
cout << g;

g. move(3);
cout << g;

g. move(3);
cout << g;

cout << "player: " << g. getPlayer() << "\n";
cout << "score: " << g. getScore(0) << " to " << g. getScore(1) << "\n";
}
First, notice you need a default constructor that sets up the initial board.

Second, you need two "getter" functions to allow public access to some game state. Specifically, getPlayer() and getScore(int player). If the game is over getPlayer() should return -1.

Next, in order to allow cout << g to work, you need to overload operator<< for output streams and your class. Output for the initial game board is shown below. Since this will require access to private data, you must make it a friend function.

This is not the whole problem but I need this portion to make sense in some C++ program format

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
question
Computers and Technology, 24.06.2019 10:10
Scanning the road can be thought of as a
Answers: 2
You know the right answer?
Write a C++ class to represent the state of a game of Mancala. It will not be responsible for choosi...
Questions
question
Mathematics, 05.06.2021 14:00
question
English, 05.06.2021 14:00
question
History, 05.06.2021 14:00
question
Mathematics, 05.06.2021 14:00
question
Mathematics, 05.06.2021 14:00
question
Mathematics, 05.06.2021 14:00
question
Mathematics, 05.06.2021 14:00
Questions on the website: 13722363