Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE SCANNER OR BUFFERED READER TO READ FILES Word Search Create a program which reads an nxn, word search board from a file. A sample
USE SCANNER OR BUFFERED READER TO READ FILES
Word Search Create a program which reads an nxn, word search board from a file. A sample word search board file would be below, where the first value in the file is the size of the board. 7 MGEDTRT OIOAHIR UGCTGRE SRUEABA EORBBAR SNISUOC EGEBART The program then reads a list of words from a file and displays whether the word is found in the board. A word may be displayed horizontally, vertically or on a diagonal, forwards or backwards. A sample word list file would be: ARE MOUSE DOG TIGER NORTH BEAR THE CAT SISTER COUSIN SOUTH BIG MICE Sample output would be: ARE was not found in the board MOUSE was found in the board DOG was found in the board TIGER was found in the board NORTH was not found in the board BEAR was not found in the board THE was not found in the board CAT was found in the board SISTER was not found in the board COUSIN was found in the board SOUTH was found in the board BIG was found in the board MICE was found in the board Your program should work for this sample file as well as other sample files.Rules for coding the lines. 1. The following will not be included in the line count. package wordsearch; import public class WordSearch { public static void main l l 2. The line count will begin after the second public line. Blank line and comments will not be included in the line count 4. One line is a single statement, ended with a semicolon. Meaning you cannot place lines together on one line. 5. Methods, and end brackets for loops/ IF statements/ Methods will count as a line in the line count. 6. A loop or an IF statement that has one associated line can be placed together. For example. if(checkWord(word,grid))5ystem.out.println(word + " was found"); else System.out.println(word + " was NOT found"); P" The IF and the Else have one associated statement each. Under these rules the program that I wrote was 35 lines. So you are getting 10 lines in addition to make 45 lines or less for the remaining ve marks. Reading Files: The following questions are to be completed using either the Scanner or Buffered Reader for file readingStep 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