Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 04:30, shadenShaden2037
What is the process in which the software development team compiles information to determine the final product
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, yola32
What is the most important for you to choose before you build a network?
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, thelordoftheknowwjo4
In a home that has 120 v service, there is an electric appliance that has a resistance of 12 ohms. how much power will this appliance consume? a. 10 w b. 120 w c 1200 w d. 1440 w
Answers: 1
image
Computers and Technology, 24.06.2019 18:30, brendahndz8676
Is a type of bullying that takes place when a person intentionally posts negative information about another person that is not true.
Answers: 2
Do you know the correct answer?
Write a C++ class to represent the state of a game of Mancala. It will not be responsible for choosi...

Questions in other subjects:

Konu
Mathematics, 21.08.2019 09:50
Konu
Mathematics, 21.08.2019 09:50
Konu
History, 21.08.2019 10:00