Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ (1) Get a line of text from the user. Output that line. Then output the line again, this time expanding all of the found

C++ (1) Get a line of text from the user. Output that line. Then output the line again, this time expanding all of the found common text message abbreviations. You can do this by using a loop. Ex:

Enter text: My BFF is David. IDK who your BFF is. You entered: My BFF is David. IDK who your BFF is. Expanded: My best friend forever is David. I don't know who your best friend forever is. 

Support these abbreviations:

BFF -- best friend forever

IDK -- I don't know

JK -- just kidding

TMI -- too much information

TTYL -- talk to you later

Note: If an abbreviation appears more than once, every instance gets expanded.

I am having trouble with the "Expected: " part of the code. I am unsure how to loop the abbreviation if it appears more than once.

image text in transcribed

1. Compare output Your bff, my BFF, and her BFF are all there Input Enter text: Your You entered Your bff, my BFF, and her BFF are all here output Expanded Your bff, my best friend forever and her best friend forever are all there 2. Compare output Are you really going to wear that? Haha, JK, JK Input Enter text: You entered: Are you really going to wear that? Haha. JK, JK Your output Expanded Are you really going to wear that? Haha, JK, JK. Enter text: You entered: Are you really going to wear that? Haha JK, JK Expected output Expanded: Are you really going to wear that? Haha, just kidding, just kidding. 3. Compare output Input TMI Just TMI I'll TTYL Enter text: You entered TMI Just TMI I'll TTYL. Your output Expanded TMI Just TMI I'll TTYL. Enter text

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago