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

I need a basic program in C to modify my program with the following instructions

ID: 3602979 • Letter: I

Question

I need a basic program in C to modify my program with the following instructions:

Create a program in C that will:

Add an option 4 to your menu for "Play Bingo"

-read in a bingo call (e,g, B6, I17, G57, G65)

-checks to see if the bingo call read in is valid (i.e., G65 is not valid)

-marks all the boards that have the bingo call

-checks to see if there is a winner, for our purposes winning means 5 tokens in a row or column 5 tokens in a diagonal( diagnols meaning upper right corner to lower left and vice versa) 1 token in each of the 4 corners of the game board

-Loop accepting bingo calls until there is a winner, and display an appropriate message specifying which user won, and how they won (5 in a row with calls B6, I20, ...; 5 in a column with calls ...; 5 on a diagonal with calls ... ; 4 corners with calls ...)

-The program created should have multiple functions here, 1 function that checks for each way of winning (row, column, diagnal, 4 corners)

Here is my program which should include program needed (copy and paste to an IDE) most of the work is done, I just need the four functions per instructions above:

#include #include int main() { int numPlayers = 0; // how many players int cardsPerPlayer = 0;//cards the user inputs per player int rows=5; int col =5; int i=0; int j=0; int k=0; int num=15; srand((int)time(0)); // generating the random seed to make unique cards while (numPlayers>5 || numPlayers<1) { printf("Please enter the number of players: "); //user to input the number of players scanf("%d", &numPlayers); if (numPlayers>5 || numPlayers<1) { printf("A maximum of 5 players per game: "); } } printf(" "); while (cardsPerPlayer>10 || cardsPerPlayer<1)//while loop to restrict user input for cards per player { printf("How many cards would you like to generate per player? ");//user to input the number of cards per player scanf("%d", &cardsPerPlayer); if (cardsPerPlayer>10 || cardsPerPlayer<1) { printf("A maximum of 10 cards per player "); } } printf(" "); int totalPlayerCards; printf("You are playing a game with %d players and each player will have %d cards. ", numPlayers, cardsPerPlayer); totalPlayerCards=numPlayers * cardsPerPlayer; printf("We have generated %d bingo cards. ", totalPlayerCards);//This indicates total amount of cards generated int bingoBoard[numPlayers][cardsPerPlayer][rows][col] ;//this is my 4 dimensional array // generates the arrays for(i=0; i< numPlayers; i++) // for loop to increment through all the players { for(j=0; j { for(rows=0; rows<5; rows++) // increments through each row { for(col=0; col<5; col++) // increments through each col { if(col==0) // generates the appropriate values for each column { bingoBoard[i][j][rows][col] = (rand()%15)+1; } if(col==1) { bingoBoard[i][j][rows][col] = (rand()%15)+16; } if(col==2) { bingoBoard[i][j][rows][col] = (rand()%15)+31; } if(col==3) { bingoBoard[i][j][rows][col] = (rand()%15)+46; } if(col==4) { bingoBoard[i][j][rows][col] = (rand()%15)+61; } } } } } for(i=0; i { for(j=0; j { for(rows=0; rows<5; rows++) { for(col=0; col<5; col++) { for(k=1; k { while (bingoBoard[i][j][rows][col] == bingoBoard[i][j][rows-k][col]) //it checks the current spot in the array and compares it to the previous values of the column { bingoBoard[i][j][rows][col] = (rand()%15) + (15*col) +1; // if the numbers match then it assigns it a new value } } } } } } //menu of options for the user to select from printf("Please choose an option from the following menu: "); printf("1) Display a bingo card "); printf("2) run a histogram across all bingo cards generated "); printf("3) exit "); int menuOptions; while (menuOptions>3|| menuOptions<1) { scanf("%d", &menuOptions); if (menuOptions>3|| menuOptions<1) { printf("That option is not available. "); printf("Choose between 1, 2, or 3 "); } } printf(" "); printf("You have chosen %d ", menuOptions); do { if(menuOptions==1) // choice 1 prints a specific card { int player; // user picked player int playerCard; // user defined card int userPlayer=0; int userCard=0; printf("Enter the player and players card you would like to display: "); scanf("%d %d", &player, &playerCard); userPlayer = player - player; userCard = playerCard - playerCard; printf("First player is %d, and last player is %d ", userPlayer, (player-1)); printf("First card is %d, last card is %d ", userCard, (playerCard-1)); printf("You are viewing player %d's Bingo Card %d ", player, playerCard); printf(" "); printf("B I N G O "); for(rows=0; rows<5; rows++) { for(col=0; col<5; col++) { if(rows==2 && col==2)//this tells program to have a "free" spot in row 2, column 2 { bingoBoard[numPlayers-1][cardsPerPlayer-1][rows][col] = -1; // sets the free spot to -1 as a flag. -1 does not get picked up by the histogram printf("free "); col++; // moves to the next spot to continue on with the array } printf("%d ",bingoBoard[player-1][playerCard-1][rows][col]); } printf(" "); } } if (menuOptions==2) // choice 2 runs a histogram on all values generated { printf("HISTOGRAM "); int l=0; int seen [75] = {0}; // array that counts how many times a value has been seen for(l=1; l<76; l++) // loops through the array { for(i=0 ; i< numPlayers; i++) // { for(j=0 ; j { for(rows=0 ; rows<5; rows++) { for(col=0; col<5; col++) { if(bingoBoard[i][j][rows][col]== l) // if any element in the array matches, l gets incremented { seen[l-1] = seen[l-1] +1; } } } } } printf("%d-%d ", l, seen[l-1]); // prints out how many times each number has been seen if (l==10)//if l equals 10, a new line will be generated { printf(" "); } if (l==20)//if l equals 20, a new line will be generated { printf(" "); } if (l==30)//if l equals 30, a new line will be generated { printf(" "); } if (l==40)//if l equals 40, a new line will be generated { printf(" "); } if (l==50)//if l equals 50, a new line will be generated { printf(" "); } if (l==60)//if l equals 60, a new line will be generated { printf(" "); } if (l==70)//if l equals 70, a new line will be generated { printf(" "); } } } printf(" "); printf(" "); //asks the user what they want to do next printf("Please choose an option from the following menu: "); printf("1) Display a bingo card "); printf("2) run a histogram across all bingo cards generated "); printf("3) exit "); scanf("%d", &menuOptions); printf("You have chosen %d ", menuOptions); if (menuOptions>3|| menuOptions<1) { printf("That option is not available. "); printf("Choose between 1, 2, or 3 "); } } while(menuOptions != 3); // program quits if user enters 3 printf("Thank you for playing! "); printf("Goodbye"); return 0; }

Here is what the output should look like:

Enter the number of players:5 Enter the number of BINGO cards per player:10 You are playing a game with 5 players and each player will have 10 cards We have generated 50 bingo cards. Please choose an option from the following menu: 1) Display a bingo card 2) run a histogram across all bingo cards generated 3) exit 4) Play Bingo! You have chosen 1 Enter the player and players card you would like to display, First player is e, last player is 4 First card is , last card is9 2 0 67 6 27 3 54 68 10 24 free 52 62 65 12 16 33 59 63 51 L AA 17 44 2 26 39 47 Please choose an option from the following menu: 1) Display a bingo card 2) run a histogram across all bingo cards generated 3) exit 4) Play Bingo! 4 You have chosen 4 Enter the called value:I17 read in I 17marking I17 on the boards Enter the called value: 172 read in I 72, Invalid Bingo Call Enter the called value: I27 read in I 27marking I27 on the boards Enter the called value: 124 read in I 24marking I24 on the boards Enter the called value: I62 read in I 62, Invalid Bingo Call Enter the called value: I26 read in I 26marking I26 on the boards Enter the called value: I16 read in I 16marking I16 on the boards we have a winner in column 1 on player 2's card # 2 117 127 124 126 116

Explanation / Answer

#include usingnamespace std; struct node { int data; node *next; node *prev; }; void addnode(); void delnode(); void display(); void show(); void search(); node *start=NULL, *temp1, *temp2, *temp3; int main() { char ch; do { char i; 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