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, 23.06.2019 00:30
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
question
Computers and Technology, 25.06.2019 06:00
Write a method public static string getdigits(string phonenumber) that takes an 11-character phone number written with any combination of 11 uppercase letters, lowercase letters and/or digits, and zero or more hyphens, and which returns the digits that a person would have to press on a cell phone to dial that phone number. we will use the mapping of letters to digits given at en.wikipedia.org/wiki/telephone_keypad# /media/file: telephone-keypad2.svg you may assume that the string parameter phonenumber contains some combination of exactly 11 uppercase letters, lowercase letters and/or digits, but that any number of hyphens may be present. you can assume that a hyphen will not appear as the first or last character of the string. do not assum
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
Mathematics, 07.10.2019 19:30
Questions on the website: 13722363