!!!!!!! IN C++ ONLY !!!!!!!! Functions We list two functions that are required, we provide an idea f

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Order a Similar Paper HERE Order a Different Paper HERE

!!!!!!! IN C++ ONLY !!!!!!!!

Functions

We list two functions that are required, we provide an idea for third optional function and you can

implement other additional functions that you find useful. You should write function comments for

each of the functions you define, containing an @brief, @param and @return similar to those we

have previously provided for you. R’Sub will test each function individually.

The first function will simulate the dice roll. Once again we want the function to be as general as

possible, so we will parameterize both the number of dice and the number of sides on a dice.

The second function returns the cell with most landings within a closed interval of board spots.

(The closed interval [5,10] means any of the values 5, 6, 7, 8, 9, or 10.)

mostLandings

* returns the cell on the board with the most “landings”, within an inclusive interval

* parameters: a vector; two integers

* first parameter: the game board vector, by const reference

* second parameter: the start of the interval to be tested, by value

* third parameter: the end of the interval to be tested, by value

* return type: integer, the index of the first cell in the interval with the most landings

Optionally, you may want (in addition to other functions you think of):

printBoard

* procedure, prints out game board, showing number of landings on each cell

* parameters: a vector

* board – the game board vector, by const reference

* return type: void

Please Help

This is what i have so far….

int mostLandings(const vector <int> &gameBoard, int begin, int finish) {
int indexNum = 0;
int maxValue = 0;
for (int i = begin; i <= finish; ++ i) {
maxValue = gameBoard.at(0);
for (int i = 0; i <= gameBoard; ++i) {
if (gameBoard.at(i) > maxValue) {
maxValue = gameBoard.at(i);
}
}
++indexNum;
}

return indexNum;
}