This assignment will involve creating a class called


Assignment

This assignment will involve creating a class called bingocard that implements a bingo card and related functions. The functions we are concerned with are as follows:

  • Filling the card with an initial set of values.
  • Marking a value & displaying a message when bingo is obtained the first time.
  • Determining how many marks away a card is from making a bingo.
  • Displaying the card values & marks.
  • Comparing two cards to see how many values they share.
  • Comparing two cards to see if they are equivalent in values & locations.

For our bingo card we shall assume the card is 5x5, the center (free) space is always marked, and the only bingos that count are the traditional single bingo of 5 values marked in a row horizontally, vertically, or diagonally.

Class details:

Implement the following functions:

  • The default constructor, which should place, in order, 1-5, 16-20, 31-35, 46-50, and 61-65 in the columns.
  • void fill(...): Fills the card.
  • int how_close(): Returns the minimum count of values needed to be marked to obtain the bingo on that card.
  • void mark(int): Marks the specific value on the card and displays a message if a bingo is found for the first time only.
  • void display(): Displays the card (using setw(5)- see example output below) and the marked values (x for marked, - for unmarked).
  • int same_values(...): Returns the count of values such that they are on both cards (but not necessarily in the same location).
  • bool equals(...): Returns true if two cards are identical with respect to both values and locations.

The ... above indicates that you need to figure out what goes there and/or it may change based on your implementation of members.

You may use whatever member variables you like for the card and you may have more member functions than the above if you deem it necessary, however use good design choices.

Attachment:- Assignment File.rar

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: This assignment will involve creating a class called
Reference No:- TGS02436370

Expected delivery within 24 Hours