Taking Sides: Plastic Bans
January 11, 2020
Branching – Tweet decoder step 1
January 11, 2020

Branching – Tweet decoder

Branching – Tweet decoder In this assignment, you’ll decode Twitter messages that include Internet abbreviations, such as LOL and IRL. The starter program decodes two abbreviations. 1. Expand the number of abbreviations that can be decoded to include the following: AFK = away from keyboard NVM = never mind BFF = best friends forever FTW = for the win IIRC = if I recall correctly TTYL = talk to you later IMHO = in my humble opinion Save your solution for this step in a file named “step1.cpp”. You’ll need to submit each step as a separate file. 2. Allow the user to enter a complete tweet (160 characters or less) as a single line of text. Use getline to get the single line of text then resize (or truncate) to 160 characters. Search the resulting string (using string’s find function) for those common abbreviations and print a list of each abbreviation along with its decoded meaning. Save your solution for this step in a file named “step2.cpp”. You’ll need to submit each step as a separate file. 3. Convert the user’s tweet to a decoded tweet, replacing the abbreviations directly within the tweet. You only need to replace the first instance of a particular abbreviation. Save your solution for this step in a file named “step3.cpp”. You’ll need to submit each step as a separate file. Here is an example program execution for step 3 (user input is highlighted here for clarity): Entertweet:I’mgoingtohangoutwithmyBFFIRLtomorrow. Decodedtweet:I’mgoingtohangoutwithmybestfriendsforeverinreallife tomorrow. Another example execution for step 3 (user input is highlighted here for clarity): Entertweet:So,IMHOhewasgoingFTW,butIwassoLOLthatmyBFFthoughtI wasgoingtostartcryingIRL!Anyway,gottago,TTYL…I’mgoingAFK. Decodedtweet:So,inmyhumbleopinionhewasgoingforthewin,butIwasso laughingoutloudthatmybestfriendsforeverthoughtIwasgoingtostart cryinginreallife!Anyway,gottago,talktoyoulater…I’mgoingaway fromkeyboard. This tweet has over 160 characters and gets truncated (user input is highlighted here for clarity): Entertweet:Anypeopleanywhere,beinginclinedandhavingthepower,have therighttoriseup,andshakeofftheexistinggovernment,andformanew onethatsuitsthembetter.Thisisamostvaluable-amostsacredright-a right,whichwehopeandbelieve,istoliberatetheworld.-AbrahamLincoln. Decodedtweet:Anypeopleanywhere,beinginclinedandhavingthepower,have therighttoriseup,andshakeofftheexistinggovernment,andformanew onethatsuitsthemb

 

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

The post Branching – Tweet decoder appeared first on Academic Heroes.

 

"Is this question part of your assignment? We Can Help!"

Nursing Coursework