Reference no: EM13307213
Write a program that implements a simple spell checker in C++. The spell checker should work as follows: prompt the user to enter a file name to spell check, and then the program will parse the file and check if there are any tokens that are not in the dictionary. Any words that are not found in the dictionary will be printed on the screen. Note that you do not need to worry about sorting words or prompting the user for corrections.
The program will be tested with two .txt files. One will be random sentences (to be spell checked) and the other will be the dictionary.
This program MUST be written using functions and arrays.
The program MUST and can ONLY contain the following function definitions and layout:
/**************************************************************
* This function takes in a filename and spells check it *
* @param file an input file stream (i.e. bonk.txt) *
***************************************************************/
void spell(string filename)
{
// function body
}
/**************************************************************
* This function takes a word from input file stream (i.e. *
* bonk.txt) and removes punctuation marks. Then, the function *
* updates the word in the caller argument (if necessary) *
* @param word a string that contains a word to be filtered *
**************************************************************/
void wordFilter(string& word)
{
// function body
}
/**************************************************************
* This function returns true if a word in input file stream *
* (i.e. bonk.txt) is in the dictionary, false otherwise. *
* @param word a string that contains a word to be checked *
* @return the Boolean status of the word (i.e. true or false) *
**************************************************************/
bool inDictionary(string word, string dictionary[])
{
// function body
}
/**************************************************************
* This is the main function of the program. *
* @return a value to terminate the program successfully *
**************************************************************/
int main()
{
// Prompt the user to enter a file to be spell checked
spell(filename);
return 0;
}
How long would it take to complete one orbit
: Suppose the shuttle increases its speed so that it has a length of 36.1 m when viewed by a stationary observer. How long would it take to complete one orbit
|
Determine what is the uniform deterministic arrival rate
: ferryboat queuing lane holds 40 vehicles. If vehicles are processed (tolls collected) at a uniform deterministic rate of 5 vehicles per minute and processing begins when the lane reaches capacity
|
How many strings of ten uppercase english letters are there
: How many strings of ten uppercase English letters are there
|
Determine the amplitude of this oscillating force
: You are at a rock concert, and the sound intensity reaches levels as high as 120 dB. Calculate the amplitude of this oscillating force
|
Write a program that implements a simple spell checker
: The program will be tested with two .txt files. One will be random sentences (to be spell checked) and the other will be the dictionary.
|
Hi-v produces three types of canned juice drink
: Hi-V produces three types of canned juice drinks, A, B and C, using fresh strawberries, grapes, and apples.
|
Chemical process-evaluated and measurable property data
: A chemical process is being evaluated and measurable property data is available for P, V, T, CP, and CV, and there is sufficient data to calculate their derivatives. Data is also available to calculate the value of entropy (S).
|
Create a monthly claim status summary report
: What data validation check would the clinic need for the new patient data entry screen? Write a brief memo with your recommendations.
|
A 150-foot-long cable of diameter
: A 150-foot-long cable of diameter 5 inches is submerged in seawater
|