Question: In this assignment you will write a C program. Your program should compile correctly and produce the specified output. Given an input file (named CrosswordInput.txt)
In this assignment you will write a C program. Your program should compile correctly and produce the specified output.
Given an input file (named CrosswordInput.txt) with the following format:
| M,N,O,S,L,I,W,E,R,E,L,Y,T,L,E,A,G,N A,H,O,O,V,E,R,T,A,Y,L,O,R,V,E,N,N,A D,F,D,R,O,O,S,E,V,E,L,T,O,N,O,M,I,M I,N,T,P,M,H,I,E,G,D,I,L,O,O,C,O,D,U S,O,N,L,I,J,Q,A,D,A,M,S,S,R,N,N,R,R O,X,L,O,G,E,F,F,M,O,I,R,E,E,G,R,A,T N,I,B,T,S,O,R,A,O,R,M,O,V,A,W,O,H,N F,N,H,U,R,R,B,C,R,N,L,R,E,G,B,E,W,E R,O,S,D,C,O,E,A,E,I,O,N,L,A,U,A,J,R K,W,U,N,L,H,H,F,N,I,O,S,T,N,S,W,A,U E,R,B,A,J,B,A,C,F,S,S,M,N,H,H,R,D,B N,E,W,L,O,T,O,N,K,E,C,E,I,H,T,H,A,N N,T,H,E,H,L,A,C,A,K,J,N,N,H,O,I,M,A E,R,G,V,N,C,A,F,I,N,G,H,U,H,A,J,S,V D,A,R,E,S,J,C,N,T,T,A,R,N,B,O,Y,A,E Y,C,A,L,O,D,L,N,O,S,I,R,R,A,H,W,E,O N,E,N,C,N,E,T,N,N,O,T,N,I,L,C,O,E,S D,A,T,Y,Y,P,O,L,K,G,A,R,F,I,E,L,D,R |
Enter file location (full path)A) Display a menu with the following options:
Display the crossword
Find a word
Exit
B) When option a is chosen:
Read a c-string from the user
Write a program to read the file content and determine the array dimensions(i.e. char crossword[x][y]: find the values for x and y that should be used as upper bound for any loop)
The size is always nxm, where n,m
Load the file content into a two dimensional array, where each cell is a character distinct of , ,\0, or (i.e. only letters are valid)
Iff the file does not exist, or it contains invalid characters, display an error message and display the main menu again.
C) When option b is chosen, display the file/array content using the following format:

D) When option c is chosen: ask the user for a word and determine whether the word was found or not (i.e. print a message like %s found! or %s was not found). (40 points)
Assume that valid words are always:
Left to right right to left or,
Top to bottom - bottom up or,
Any combination @ 45 degrees (i.e. from left(top) to bottom(right))
If the word is found, use a structure to store: the word and the row/col coordinates
E) When option d is chosen, exit the program.
Deliverables
You will turn in two files, a Text file and a C source code file.
The text file should contain:
Instructions to compile and use your program
Whether it could find or not the following words using the input file provided by the instructor: (10 points)
KENNEDY
ROOSEVELT
PIERCE
CLINTON
LINCOLN
The C source code file should:
Comply with all of the formatting requirements already discussed.
Display the output
NAMURmTNERUBNAVEOSR GNm_ D R A H W J A D A M SAEED LVN0wREwA G A N H H H H BALI YOTLSRORNSMENHRRNR ETEEAFmA C A F C N C F N N N L SOwR P L O T U D N A L E V E L C Y OODTNLBHSUBWHGRANT NHFNOXINOWRETRACEA MADISONFRKENNEDYND
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
