Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a 5x5 Array of integers called board. You will also need a 5x5 2D array of Booleans called markers. Assign random numbers to board

Create a 5x5 Array of integers called board. You will also need a 5x5 2D array of Booleans called markers. Assign random numbers to board within the constraints described below: The first column must only have numbers between 1 and 15. The second column must only have numbers between 16 and 30. The third column must only have numbers between 31 and 45. The fourth column must only have numbers between 46 and 60. The fifth column must only have numbers between 61 and 75. You may NOT have any duplicate numbers! You can keep track of this in a 1D array of Booleans like how you will track the draw. You will create a single array of Booleans that is the size of 75 called drawn. The main game loop will proceed as follows: Find a random number between 1 and 75. Make sure that it has not been drawn (drawn is false at that index) While the random number has been drawn, keep finding a new random number. Set the appropriate element in drawn to true and print out the random number. See if the board 2D array has the random number drawn. If it does, set markers at the same row and column to true. o Print the board, but print a # on any number that has been drawn. When you get to the number that was just drawn, print an O (that way we can see what changed). Do not print the board if it did not have a random number. Determine if there is a Bingo. If you have five in a row. If you have five in a column Or if you have Diagonals The game will play until there is a Bingo, I should be able to scroll up and see the progress of the game. At the end you will print how many turns it took to get Bingo

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions