Are you looking to make this a graphical application, or something that runs on a command line? Graphical might be a bit more involved, and you will almost certainly need to use a visual editor.
In C++, text can be handled in a few ways. The most common, and easiest to deal with these days is the string class.
http://www.cplusplus.com/reference/string/string/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
#include <string>
using namespace std;
string myString;
int main() {
cout << "Enter a string: ";
cin >> myString;
if(myString == "Hello") {
cout << "1bcae" << endl;
}
//... put more if/else statements here as needed
return 0;
}
|
That will run a very simple program reading in a string of text from the user, checking it against the word "Hello", then if it matches, it will print the string "1bcae".
You can add more of those if checks down the list, but the program will not break apart the string. If a user enters a sentence for instance, it will check the entire sentence against a word. If you want it to break the sentence apart into each word, and check each of them, the program will get a bit more involved. You will then need to find the break points in your string (spaces, tabs...) and use the substr function to extract the "words" one at a time from the sentence, then compare those to your list of converted words in a loop (most likely a while loop).