Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 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.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

Under what circumstances are pay differentials justified?

Answered: 1 week ago