Click here to Skip to main content
15,922,419 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionMixed Mode, Pinning Pointers Pin
Mark Salsbery30-Oct-06 13:39
Mark Salsbery30-Oct-06 13:39 
AnswerRe: Mixed Mode, Pinning Pointers Pin
Nish Nishant30-Oct-06 16:28
sitebuilderNish Nishant30-Oct-06 16:28 
GeneralRe: Mixed Mode, Pinning Pointers Pin
Mark Salsbery30-Oct-06 17:37
Mark Salsbery30-Oct-06 17:37 
GeneralRe: Mixed Mode, Pinning Pointers Pin
Nish Nishant31-Oct-06 2:01
sitebuilderNish Nishant31-Oct-06 2:01 
GeneralRe: Mixed Mode, Pinning Pointers Pin
Mark Salsbery31-Oct-06 5:12
Mark Salsbery31-Oct-06 5:12 
Questionregistering a plugin Pin
saqib8230-Oct-06 1:58
saqib8230-Oct-06 1:58 
AnswerRe: registering a plugin Pin
led mike30-Oct-06 4:54
led mike30-Oct-06 4:54 
QuestionCan anyone help me? Pin
francium30-Oct-06 1:49
francium30-Oct-06 1:49 
Write a C++ program that implements a very simple spell checker.

1. Specification
A spell checker is a program that verifies the spelling of words in a document. Your program should prompt the user to input some text, find out which words are misspelled and finally give output as described below.
The following is an example illustrating the behaviour of the program:
csh> ./ex3
Input text (enter END to stop):
Twinkle, twinkle, little ster,
How I wondre what you are
END
Extracted words:
Twinkle,twinkle,little,ster,How,I,wondre,what,you,are
Marked text:
Twinkle, twinkle, little #ster#,
#How# I #wondre# #what# #you# #are#

Input
When the program is executed, the user is requested to input multiple lines of text. The input is stopped when a line containing only "END" is entered. "END" will NOT be treated as part of the input text.

Processing
After the text is input, the program should determine which words are misspelled. A word is defined as a string of letters (upper or lower case) preceded and followed by a non-letter (e.g. space, tab, number,punctuation mark). It also includes strings of letters appearing at the beginning and/or end of a line.
For example, in the following input line:
How I wondre what@you are
Six words can be extracted:
How,I,wondre,what,you,are
After the words are extracted, the program should determine which are misspelled. Please see next section for details about misspelling checking.
replace it with your own information
output 1
output 2
continue inputting until
END is entered

Output
Finally, the program should output two things:
1) The extracted words with each word separated from the next one by a comma. The order of appearance of the words to be output should follow that of the input.
2) The input text with all misspelled words enclosed by a pair of '#'. Nothing else should be added or removed from the output.

2. Misspelling Checking
Your program must include a header file ex3.h which is to be provided by your instructor during marking.

The header file will look like the following:
// example of ex3.h - will be different during actual marking
#define MAX_WORDS 4
char dictionary[MAX_WORDS][20] = { "i", "twinkle", "little", "star" };
Your program must include ex3.h (located at the same directory of your source file) and make use of the
constant MAX_WORDS and the array dictionary to perform misspelling checking. E.g.
// your program will look like the following
#include <iostream>
#include <cstring>
...
#include "ex3.h" // ex3.h is provided by your instructor
int main()
{
...
// example of use of MAX_WORDS and dictionary
for (int i=0; i < MAX_WORDS; i++) {
... dictionary[i] ...
}
}
During debugging, you should create your own ex3.h to test your program.
In ex3.h, the constant MAX_WORDS specifies the number of strings contained within the array dictionary.
The array dictionary contains all the words you would use to check against the extracted words in the input text. If an input word cannot be found in dictionary, it should be considered a misspelled word.
The checking is case insensitive, e.g. "Twinkle" is equivalent to "twinkle"
As stated in the above section, misspelled words should then be enclosed by '#' in the output.

3. Important Points
1) You can assume that the maximum number of input lines is 100 and the maximum length of each line is
100 characters.
2) To input a line, you can use a statement like:
char buffer[200];
cin.getline(buffer, 200, '\n');
// buffer contains the input from the user, with the newline removed
3) The output should be a correct sequence of characters. You should NOT use a backspace to "erase" the
preceding character. For example, the following are NOT the same:
"abc<backspace><backspace>def" not the same as "adef"
AnswerRe: Can anyone help me? Pin
led mike30-Oct-06 4:53
led mike30-Oct-06 4:53 
AnswerRe: Can anyone help me? Pin
Christian Graus30-Oct-06 16:25
protectorChristian Graus30-Oct-06 16:25 
QuestionPriority to system timers Pin
RSangeetha29-Oct-06 21:59
RSangeetha29-Oct-06 21:59 
AnswerRe: Priority to system timers Pin
Jonathan [Darka]30-Oct-06 3:46
professionalJonathan [Darka]30-Oct-06 3:46 
Questiongames Pin
ammoh29-Oct-06 20:56
ammoh29-Oct-06 20:56 
AnswerRe: games Pin
toxcct30-Oct-06 5:29
toxcct30-Oct-06 5:29 
AnswerRe: games Pin
Vega0230-Oct-06 9:55
Vega0230-Oct-06 9:55 
QuestionInputing data from .txt to array. Pin
Ramper29-Oct-06 15:58
Ramper29-Oct-06 15:58 
AnswerRe: Inputing data from .txt to array. Pin
Jun Du30-Oct-06 14:15
Jun Du30-Oct-06 14:15 
QuestionCan someone help me with sound control? Pin
crystal0049029-Oct-06 5:26
crystal0049029-Oct-06 5:26 
AnswerRe: Can someone help me with sound control? Pin
Mark Salsbery29-Oct-06 17:46
Mark Salsbery29-Oct-06 17:46 
Questioncan u help me Pin
scorpioninstyle28-Oct-06 9:08
scorpioninstyle28-Oct-06 9:08 
AnswerRe: can u help me Pin
Christian Graus28-Oct-06 11:27
protectorChristian Graus28-Oct-06 11:27 
QuestionLinux Active Process List Pin
feritunal27-Oct-06 22:52
feritunal27-Oct-06 22:52 
AnswerRe: Linux Active Process List Pin
George L. Jackson28-Oct-06 6:20
George L. Jackson28-Oct-06 6:20 
QuestionBYTE to unsigned char Pin
samkook27-Oct-06 12:54
samkook27-Oct-06 12:54 
AnswerRe: BYTE to unsigned char Pin
Christian Graus27-Oct-06 15:54
protectorChristian Graus27-Oct-06 15:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.