Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 || numPlayers5 || numPlayers10 || cardsPerPlayer10 || cardsPerPlayer3|| menuOptions3|| menuOptions3|| menuOptions

Here is what the output should look like:

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions