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 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
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
English, 29.01.2021 23:30
question
English, 29.01.2021 23:30
question
English, 29.01.2021 23:30
question
Mathematics, 29.01.2021 23:30
question
Chemistry, 29.01.2021 23:30
question
Mathematics, 29.01.2021 23:30