Write a program that implements a simple spell checker

Assignment Help Basic Computer Science
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;
}

 

Reference no: EM13307213

Questions Cloud

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

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd