Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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;
}

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9886532

Have any Question?


Related Questions in Computer Engineering

Question why most of the researchers in the field of arabic

Question : Why most of the researchers in the field of Arabic text classification collected their own corpus and what is In-house Arabic corpus. The response must be typed, single spaced, must be in times new roman font ...

Take the master boot record from this weeks module and use

Take the master boot record from this week's module and use it as a file input for your program. It will be named block.dd and you can assume that it's in your current directory so you don't have to provide a path to it. ...

Assignment write an 8-page apa formatted paper on a

Assignment: Write an 8-page APA formatted paper on a business problem that requires data mining, why the problem is interesting, the general approach you plan to take, what kind of data you plan to use, and finally how y ...

Question suppose a payroll system secretly leaks a list of

Question : Suppose a payroll system secretly leaks a list of names of employees earning more than a certain amount each pay period. Who would be harmed by such a vulnerability? How could such a vulnerability come about? ...

Question research microwave serices and report on what

Question : Research microwave serices and report on what kinds of applications can be supported, what equipment will be necessary, where the equipment will be located, and what services these companies that offers.

Small java programcreate an int called num and initialize

Small Java Program: Create an int called num and initialize it to 5000. Create an int called reps and initialize it to 0. Use a for loop control structure that runs if num is greater than or equal to 250, subtracting 139 ...

In fostering understanding of utilizing big-oh notation in

In fostering understanding of utilizing Big-Oh notation in an application, please provide a simple java code segment that illustrates how Big-Oh can be utilized to pinpoint performance problems.

With respect to tm4c123 arm cortex m4 processorhow many

With respect to TM4C123 ARM Cortex M4 Processor How many machine cycles are required to process first line of ISR after an interrupt occurs? What are the other benefits of NVIC to process interrupt more efficiently?

You are running a memory-intensive multimedia application

You are running a memory-intensive multimedia application on your computer, which has 1 GB RAM installed. You observe that the computer momentarily stops responding when you switch between two multimedia applications. 1. ...

Question in relational algebra is the set difference

Question : In relational algebra: is the set difference commutative or not and Why? What is the difference between multivalued and composite attribute? Explain with Example.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As