Help implementation

I need help with two questions. I need more time to do it myself, as I'm beginner, but I would appreciate it if someone could do the following two questions.

1. Spell Checker. We are provided two files. One "dictionary.txt," the other one a user file (say "bonk.txt"). We have to take the user file and compare every word with dictionary and list the words that are not found in the dictionary. We have to remove punctuations etc. We can't use advanced programming like vectors or lists, only arrays, pointers and function. We should not use more than the following functions:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**************************************************************
* 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
}


=================================================================================

2. We have to provide the user with 3 choices: 1. Encypt 2. Decrypt 3. Continue or Exit. If user chooses 1, We have to ask for input file and output file names. we have to ask for a file and encypt it based on a formula. On choice two, again we have to ask for two file names and decrypt the file. Here is the flow:

Please enter a choice:
1. Encrypt
2. Decrypt
3. C continue E exit
-------------------------
1.
--->Please enter a file to encrypt:
--->Please enter a name for the output (encrypted) file:

2.
--->Please enter a file to decrypt:
--->Please enter a name for the output (decrypted) file:

3. continue or exit

Here are the functions that we are allowed to use:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**************************************************************
* This function displays the menu options as in the handout *
**************************************************************/
void displayMenu()
{ /* function body */ }
/**************************************************************
* This function encrypts the content of infile and saves the *
* encrypted text into outfile *
* @param infile string (file that has raw text) *
* @param outfile string (file that will have encrypted text) *
**************************************************************/
void encrypt(string infile, string outfile)
{ /* function body */ }
/**************************************************************
* This function decrypts the content of infile and saves the *
* decrypted text into outfile *
* @param infile string (file that has encrypted text) *
* @param outfile string (file that will have decrypted text) *
**************************************************************/
void decrypt(string infile, string outfile)
{ /* function body */ }
/**************************************************************
* This function takes an character and a cipher key to return *
* an encrypted character. *
* @param c is a char (the character to be encrypted) *
* @param key is an integer (cipher key given in the handout) *
**************************************************************/
char ceaserCipher(char c, int key)
{ /* function body */ }
/**************************************************************
* This function takes an encrypted character and a cipher key *
* to return a decrypted character. *
* @param c is a char (the character to be decrypted) *
* @param key is an integer (cipher key given in the handout) *
**************************************************************/
char ceaserDecipher(char c, int key)
{ /* function body */ }
/**************************************************************
* This is the main function of the program. *
* @return a value to terminate the program successfully *
**************************************************************/
int main()
{
displayMenu();
// 1. Get user input (e.g. encrypt/decrypt and filenames)
// 2. Call the appropriate function(s) to process encryption/decryption
// 3. Then, get user input to continue or exit the program
return 0;
}



Your help is greatly appreciated.
Last edited on
Erm, I don't see a good reason to do your homework for you. :/
Topic archived. No new replies allowed.