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

  Write recursive c++ function returns the sum

Given an integer n > 0, write a recursive C++ function that returns the sum of 1 through n.

  Write single statement print message first is followed first

Write a single statement that will print the message "first is " followed by the value of first, and then a space, followed by "second = ", followed by the value of second.

  Distinguish web pages or web servers use for task

Suppose the role of the IT consultant to new nonprofit organization, Free Flu, to provides flu shots to the elderly. The organization requires the domain name. Distinguish between any Web pages or Web servers you would use for task.

  Structured english for clyde-s narrative of reimbursement

On trip lasting more than one day, we permit hotel, taxi, and airfare, also meal allowances. Same times apply for meal expenses." Write structured English for Clyde's narrative of reimbursement policies.

  Find all companies located in every city

Assume the companies may be loacted in several cities. Find all companies located in every city in which small bank corporation is located. Write relational algebra query. Use  in database system concepts sixth edition for schema.

  What are purpose active directory folders and limitatation

What are purpose of Active Directory folders (not share folder)

  Identify potential business environments

Compare and contrast benefits and challenges that exist between centralized database management systems and distributed database management systems. Identify potential business environments where each can be properly used.

  How beginning station on horizontal alignment changed

What does InRoads set as default starting station any new horizontal alignments? How is beginning station on the horizontal alignment changed?

  How repeated measurement enhanced accuracy

Assume that hypothesis to be tested was that girls are taller than boys. This time boy and the girl were each measured 30 times with ruler which read to 1,400 of an inch.

  What interface does an application need to use

What interface does an application need to use if it wants to get updates on the current position of the mouse cursor as the mouse is being moved? How does the program get the x,y coordinates of the mouse cursor?

  Find the transmission rate in bits per second

Suppose all headers (including RTP, UDP and IP) have a total length of h and an IP datagram is emitted every 40 msecs.

  How organizations communicate with prospective

In this assignment, you will locate examples of how the use of digital media was used to communicate information to achieve a specific goal of an organization or individual.

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