- #1
carl123
- 56
- 0
1) Create a few tweet abbreviations that can be decoded. Add support for abbreviations.
2) For abbreviations that do not match the supported abbreviations, check for common misspellings. Provide a suggestion for correct abbreviation along with the decoded meaning. For example, if the user enters "LLO", your program can output "Did you mean LOL? LOL = laughing out loud".
3) Allows the user to enter a complete tweet (140 characters or less) as a single line of text. Search the resulting string for those common abbreviations and print a list of each abbreviation along with its decoded meaning.
4) Convert the user's tweet to a decoded tweet, replacing the abbreviations directly within the tweet.
I already did number 1.
This is what I have so far:
2) For abbreviations that do not match the supported abbreviations, check for common misspellings. Provide a suggestion for correct abbreviation along with the decoded meaning. For example, if the user enters "LLO", your program can output "Did you mean LOL? LOL = laughing out loud".
3) Allows the user to enter a complete tweet (140 characters or less) as a single line of text. Search the resulting string for those common abbreviations and print a list of each abbreviation along with its decoded meaning.
4) Convert the user's tweet to a decoded tweet, replacing the abbreviations directly within the tweet.
I already did number 1.
This is what I have so far:
Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
string origTweet;
cout << "Enter abbreviation from tweet: " << endl;
cin >> origTweet;
if (origTweet == "LOL") {
cout << "LOL = laughing out loud" << endl;
}
else if (origTweet == "BFN") {
cout << "BFN = bye for now" << endl;
}
else if (origTweet == "FTW") {
cout << "FTW = for the win" << endl;
}
else if (origTweet == "IRL") {
cout << "IRL = in real life" << endl;
}
else if (origTweet == "ILY") {
cout << "ILY = i love you" << endl;
}
else if (origTweet == "OMG") {
cout << "OMG == oh my gosh" << endl;
}
else {
cout << "Sorry, don't know that one." << endl;
}
return 0;
}