Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment is in C++ and I want help with this problem for Questions 2 and 3. Can you please separate the problems so I

This assignment is in C++ and I want help with this problem for Questions 2 and 3.

Can you please separate the problems so I know which one is for which.

Please post code so that I can see what you did.

Branching - Tweet decoder

In this assignment, youll 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. Youll 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 strings 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. Youll 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. Youll 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):

Enter tweet:

I'm going to hang out with my BFF IRL tomorrow.

Decoded tweet: I'm going to hang out with my best friends forever in real life

tomorrow.

Another example execution for step 3 (user input is highlighted here for clarity):

Enter tweet:

So, IMHO he was going FTW, but I was so LOL that my BFF thought I

was going to start crying IRL! Anyway, gotta go, TTYL... I'm going AFK.

Decoded tweet: So, in my humble opinion he was going for the win, but I was so

laughing out loud that my best friends forever thought I was going to start

crying in real life! Anyway, gotta go, talk to you later... I'm going away

from keyboard.

This tweet has over 160 characters and gets truncated (user input is highlighted here for clarity):

Enter tweet:

Any people anywhere, being inclined and having the power, have

the right to rise up, and shake off the existing government, and form a new

one that suits them better. This is a most valuable - a most sacred right - a

right, which we hope and believe, is to liberate the world. - Abraham Lincoln.

Decoded tweet: Any people anywhere, being inclined and having the power, have

the right to rise up, and shake off the existing government, and form a new

one that suits them b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago