Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that acts as a simple spell checker. Functional requirements Your program will open a file named dictionary.txt which is located in

Write a Java program that acts as a simple spell checker.

Functional requirements

Your program will open a file named dictionary.txt which is located in the same directory as the .class file. This file will contain a list of valid words, with one word per line. After reading the dictionary file the program prompts the user with "Please enter the pathname of the file to be spell-checked: " If the file cannot be opened, the program ends. Otherwise, the user's file is parsed into lines. Each word within a line is compared to the list of valid words from dictionary.txt. If there is no match, the program reports the misspelled word and line number. Word matching is case insensitive and ignores end punctuation. So if "dog" is in dictionary.txt, then "Dog?" is a valid word. When reporting that a word is misspelled the end punctuation should not be shown. So if "YYZ!" appears in the user's file, the program should report "YYZ misspelled on line 5".

Non-functional requirements

In addition to a main class for your application, you should write a Dictionary class, which reads data from a file and efficiently (binary search) determines whether a given work is in the dictionary. Dictionaries are immutable, so the default constructor should throw an exception; a valid dictionary is constructed using the name of a dictionary file.

You may not use generics in completing this assignment.

Write a makefile that compiles all of your .java files and also will clean (delete) all class files with "make clean".

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

Step: 3

blur-text-image

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

Advances In Databases 28th British National Conference On Databases Bncod 28 Manchester Uk July 2011 Revised Selected Papers Lncs 7051

Authors: Alvaro A.A. Fernandes ,Alasdair J.G. Gray ,Khalid Belhajjame

2011th Edition

3642245765, 978-3642245763

More Books

Students also viewed these Databases questions