Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a C++ Program that requires multiple parts. I need help with it. Use arr

ID: 3886895 • Letter: T

Question

This is a C++ Program that requires multiple parts. I need help with it. Use arrays, constructors, classes, public, private, and functions.

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. o void fill(...: Fills the card o int how_close ):Returns the minimum count of values needed to be marked to obtain the bingo on that card o o void mark (int): Marks the specific value on the card and displays a message if a o void display (): Displays the card (using setw (5) - see example output below) and o int same_values(...):Returns the count of values such that they are on both cards o bool equals ( . . ) : Returns true if two cards are identical with respect to both values bingo is found for the first time only the marked values (x for marked,-for unmarked) (but not necessarily in the same location). 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. .

Explanation / Answer

bingocard.h

#include<stdio.h>

string line;

bool f=true;

int total=0

class bingoCard {

public:

int card[5][10;

int counter =0;

bingoCard(){

card[2][7] = x;

for(int i=0;i<5;i++)

{

for(int j=0;j<5;j++)

{

                    this.card[j][i]=++counter;

}

counter += 11;

}

}

void fill(int cd[5][5]);

void mark(int m);

intcheckh(int a[5][10]);

intcheckv(int a[5][10]);

intcheckd1(int a[5][10]);

intcheckd2(int a[5][10]);

void display();

int same_values();

bool equals();

}

bingocard.cpp

#include<stdio.h>

#include<bingocard.h>

void bingoCard : : fill(int cd[5][5]){}

void bingoCard : : mark(int m){

for(int i=0;i<5;i++)

{

for(int j=0;j<5;j++)

{

if(a[i][j]==m)

{

a[i][j]=x;

}}

}

}

int bingoCard : :checkh(int a[5][10]){

int c=0,d=0;

for(int i=0;i<5;i++)

{

for(int j=0;j<5;j++)

{

if(a[i][j]==0)

{c++;

}

if(c==5)

{

d++;

c=0;

}}c=0;}

return d;

}

int bingoCard : :checkv(int a[5][10]){

int c=0,d=0;

for(int i=0;i<5;i++)

{

for(int j=0;j<5;j++)

{

if(a[j][i]==0)

{c++;

}

if(c==5)

{

d++;

c=0;

}}c=0;}

return d;

}

int bingoCard : : checkd1(int a[5][10]){

int c=0,d=0;

for(int i=0;i<5;i++)

{

if(a[i][i]==0)

{c++;

}

}

if(c==5)

{

d=1;

}return d;

}

int bingoCard : :checkd2(int a[5][10]){

int c=0,d=0;

for(int i=0;i<5;i++)

{for(int j=4;j>=0;j--)

{

if(a[i][j]==0)

{c++;

}

}

if(c==5)

{

d=1;

}}return d;

}

}

void bingoCard : : display(){

for(int i=0;i<10;i++)

{

for(int j=0;j<10;j++)

{

          cout<<this.card[i][j];

}

cout<<endl;

}

}

int bingoCard : : same_values(){}

bool bingoCard : : equals(){}

main.cpp

#include<iostream.h>

#include<fstream.h>

#incude<bingocard.h>

using namespace std;

int main(int argc, char *argv[])

{

            if ( argc != 2 )

            {

                        cout<<”No File Specified”<<endl;

                        exit(1);

            }

            ifstream inFile;

            inFile.open(argv[1]);

            if (!inFile) {

            cerr << "Error reading File!!"<< endl;

            exit(1);

            }

            bingoCard bc,bc1;

            int h,v,d1,d2;

            while(getline(inFile,line)) {

            if (line == f1) {                       bc.fill(bc1);      }

            if (line == f2) {                       bc.fill(bc2);      }

            if (line == m) {                       

                        string temp;

                        getline(inFile,temp);

                        bc2.mark(int(temp));  

                        h = bc2.checkh(bc2.card);

                        v = bc2.checkv(bc2.card);

                        d1 = bc2.checkd1(bc2.card);

                        d2 = bc2.checkhd2(bc2.card);

                        int total = h+v+d1+d2;

                        if (total == 5 && f ==true)

                        {          cout<<”BINGO!!!”; f=false; }

            }

            if (line == c) {            

            int cl = bc2.how_close();

            cout<<”This card is”<<cl<<”away”<< endl;

            }

            if (line == d) {             bc2.display(); bc2.display();    }

            if (line == s) {            

            int sv =bc2.same_values();     

            cout<<”The cards have ”<<sv<<”values in coomon”<< endl ;

            }

            if (line == e) {            

            bool flag = bc2.equals();

            if (bool)

                        cout<<”Both the cards are equal”;

            else

                        cout<<””;

            }

            }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote