Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Bingo card consists of 5 columns and 5 rows. Each column has a range of numbers from which the spaces in that column can

A Bingo card consists of 5 columns and 5 rows. Each column has a range of numbers from which the spaces in that column can be populated:

Column 0 (the B column): 1-15

Column 1 (the I column): 16-30

Column 2 (the N column): 31-45

Column 3 (the G column): 46-60

Column 4 (the O column): 61-75

No number is repeated in any column. The center space is considered a free space and has no number (it is considered automatically marked).

In a game of Bingo, numbers are called randomly, and those numbers apply to all cards in play. Any cards in play may mark any number that is called if it appears on that card. It is common to call bingo numbers with the letter of their column, such as B-12, but this is not necessary, since a 12 can only be in the B column.

The first card that marks a complete line of spaces either horizontally, vertically, or diagonally wins immediately.

Implement the following class for a bingo card. The methods shown are a minimum requirement. You may add additional methods if you wish.

cardNumbers: int []

-cardMarks: boolean [][]

-calls: int [] -callsMade: int +BingoCard() +BingoCard(numbers: int [][]) -setNumber(number: int, row: int, col:int): void +getCardNumbers(): int [][] +getCardmarks(): boolean [][] +markCard(): void +isBingo(): Boolean +setCalls(int []): void +getCalls(): int [] +addCall(int callNumber): void

There may not be more than two statements using array indices which do not change.

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