Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Branching – Tweet decoder step 3

include

include

using namespace std;

int main() {
string tweet;
int pos;

//Prompts user for tweet
cout << "Enter tweet: ";
getline(cin, tweet);

//Searches tweet for tweet abbreviations and replaces them with their respective definitions
pos = tweet.find("LOL");
if (pos >= 0) {
    tweet.replace(pos, 3, "laughing out loud");
}
pos = tweet.find("IRL");
if (pos >= 0) {
    tweet.replace(pos, 3, "in real life");
}
pos = tweet.find("AFK");
if (pos >= 0) {
    tweet.replace(pos, 3, "away from keyboard");
}
pos = tweet.find("NVM");
if (pos >= 0) {
    tweet.replace(pos, 3, "nevermind");
}
pos = tweet.find("BFF");
if (pos >= 0) {
    tweet.replace(pos, 3, "best friends forever");
}
pos = tweet.find("FTW");
if (pos >= 0) {
    tweet.replace(pos, 3, "for the win");
}
pos = tweet.find("IIRC");
if (pos >= 0) {
    tweet.replace(pos, 4, "if I recall correctly");
}
pos = tweet.find("TTYL");
if (pos >= 0) {
    tweet.replace(pos, 4, "if I recall correctly");
}
pos = tweet.find("IMHO");
if (pos >= 0) {
    tweet.replace(pos, 4, "in my humble opinion");
}

//Outputs decoded tweet
cout << endl << "Decoded tweet: " << tweet << endl;

return 0;

}

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"