Question
Modify the following code to make an interface to allow for the entry of a candidate word If the word if found, the user interface
- Modify the following code to make an interface to allow for the entry of a candidate word
- If the word if found, the user interface will indicate this, if not, it will also inform the user
# include
# include
# include
int x;
int y;
char grid [10] [10];
int z;
int j;
int main()
{
// declare array withalphabet
char alphabet[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z' };
printf ("Insert the width (x) and height (y) of the grid ");
scanf ("%d %d", &x, &y);
for (z = 0; z < x; z++)
{
for (j=0; j < y; j++)
{
// print letters instead of dots
grid [z] [j] = alphabet[rand() % 26];
}
}
for (z = 0; z < x; z++)
{
for (j=0; j < y; j++)
{
printf ("%c", grid [z] [j]);
}
printf (" ");
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started