Question: computer language C++ (Connect 4 game)( this is all the info that was givin no input or solution) I used the most recent version of

computer language C++ (Connect 4 game)( this is all the info that was givin no input or solution) I used the most recent version of Microsoft visual studio for this program)

Your solution must have these classes and at least these fields / methods. Your program must use the methods described in a meaningful fashion. You can create additional fields or methods but these the below should be core methods in your solution.

Checkers class

fields:

color

methods:

Constructor

int getColor()

string toString() - returns an attractive string representation of itsel

f Board class

fields:

2D array of checkers - represents the game board (6 row by 7 column)

methods:

constructor string toString() - returns an attractive string representation of itself

This needs to be an attractive table representation of the game board with aligned rows / columns with characters representing blank cells, cells with a red checkers in it and cells with a gold checkers in it

. int dropChecker(Checker, int) - drops a checker object down a particular slot. Returns an int indicating success or not. int isWinner() - returns code number representing no winner or player number of winner

Player class

fields:

name

color

methods:

Constructor

get / set methods for fields string toString() - string representation of itself. Example String representation of the board (X means blank, R means red checker, G means gold checker)

X X X X X X X

X X X X X X X

X X X X X G X

X X X X X R X

X X X X X R X

X R G G G R G

Main Your program should create two Players and a Board. It should represent the initial Board to the screen. You should then alternate between player 1 and player 2 and randomly drop checkers down slots in the board. You should represent the board after each checker drop. This should stop if there is a winner or if the board fills up. You should be turning in a Checker.h, Checker.cpp, Board.h, Board.cpp, Player.h, Player.cpp and a main.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!