Question: ( 1 6 % ) In a board game, there is an 8 8 board which contains jewels in the squares. The jewels are represented

(16%) In a board game, there is an 88 board which contains jewels in the squares. The
jewels are represented by uppercase letters A-Z. The game would need to count the number
of horizontal and vertical sequences of three or more of the same jewel, e.g., AAA, BBB,
etc. An example board is shown below which contains four horizontal sequences and three
vertical sequences. These sequences are highlighted in red rectangles.
Write a program (file name: Q2.cpp?) with a function void count3(char board [][8],
int &h, int &v); that finds the number of such horizontal and vertical sequences in
the two-dimensional array parameter board. At the end of the function, the reference pa-
rameters h and v should store the number of horizontal and vertical sequences respectively.
E.g., suppose board contains the contents as shown above, then calling count 3(board,
h,v shall write 4 and 3 to h and v respectively.
Note:
You can assume that parameter board is always of size 88.
You can assume that parameter board always contains only uppercase letters A-Z.
What you write in the main () function is unimportant. It may contain code to test-call
the required function. We shall grade only the required function.
 (16%) In a board game, there is an 88 board which

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!