APlusGrades

Not Rated (0)

$15/per page/Negotiable

About APlusGrades

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing,Foreign Languages,Geography,Geology,Health & Medical,HR Management,Law,Management,Physics,Programming,Science,Statistics Hide all
Teaching Since: Jul 2017
Last Sign in: 374 Weeks Ago
Questions Answered: 1850
Tutorials Posted: 1850

Education

  • Graduate in Biology and Nutrition, MBA Finance
    Florida State University
    Aug-2000 - Jul-2007

Experience

  • Ass. Relationship Manager
    Penn-Florida
    Mar-2009 - Feb-2016

Category > Computer Science Posted 21 Jul 2017 My Price 12.00

Program 1 Lost Survivor Fall 2013

Question:

Purpose : classes, recursion, 2 dimensional Arrays, test plan, machine). (C++ use Input & output)

Universal Merriment Design (UMD) is building an electronic checkers game. They have hired you to write a small part of the game. Given the position on the board, you need to compute the maximum number of jumps of one specific king checker in one turn. Checkers is played on a board made up of 8 rows and 8 columns of alternating black and white squares. A king making a capturing move (a jump) leaps over one of the opponent's pieces, landing in a straight diagonal line on the other side and the opponents's piece is removed from the board. If the landing square is occupied, that jump is not legal. Only one piece may be captured in a single jump (and removed from the board); however, multiple jumps are allowed on a single turn

Input:

The input will consist of multiple test cases. The first line of input will be an integer n, indicating the number of test cases. Each test case will begin with 2 integers (m and n) on 1 line , separated by a space, specifying the number of your pieces and the number of your opponent's pieces. The next m lines will contain the row (0 < r < 7) and column (0 < c < 7) information for each of your pieces separated by a space. The last n lines will contain the row (0 < r < 7) and column (0 < c < 7) information for each of your opponents pieces separated by a space.

Output:

Each test case will result in 1 line of output with the phrase, "the number of jumps is x", where x is the number of jumps your first piece (a king) can make legally.

Sample Input (from the single and triple jumps illustrated above)

2

1 1

3 3

4 4

1 4

3 3

4 4

6 6

6 2

6 4

Sample Output

the number of jumps is 1

the number of jumps is 3

Pre/Post conditions for functions
Functionality (minimum functions you should have)

void addChecker(char who, int r, int c)

// puts who at position (r,c)
void print() // prints the board
int main()
int numJumps(int row, int col)// returns the number of jumps a checker can make starting at (row, col)

void reset( ); //clears the board

Required Data Structure

You can add more to the data structure but the minimum should be :

Class Board

{

public:

Board(); //creates an empty board

void reset( ); //clears the board

void addChecker(char who, int row, int col);

int numJumps(int row, int col); // num of jumps possible from row, col

void print() ; // print the board for debugging only

private:

char board[8][8];

};

Attachments:

Answers

Not Rated (0)
Status NEW Posted 21 Jul 2017 04:07 PM My Price 12.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â-----------  -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I

Not Rated(0)