Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with the following question. please code it in C++, as simple as possible and no function please. beside the question i am

Please help me with the following question. please code it in C++, as simple as possible and no function please. beside the question i am attaching the file that contains some code already provided. Thank youimage text in transcribedimage text in transcribed

0 learn.zybooks.com co + Use getline() to get a line of user input into a string: Enter text: IDK if I'll go. It's my BFF's birthday. Search the string using find() for common abbreviations and replace() them with their long form. In addition, use a for loop to iterate through each character of the string and replace any occurences of'!' with : Enter text: IDK if I'll go. It's my BFF's birthday. I don't know if I'll go! It's my best friend forever's birthday! Use loops for each abbreviation to replace multiple occurrences: Enter text: Hi BFF. IDK where I'm going but it's not going to be with you! JK you know you're my BFF. IDK why I just said that. Anyway, TMI. Why do I always give people TMI? IDK. Alright TTYL bye BFF! Hi best friend forever! I don't know where I'm going but it's not going to be with you! just kidding you know you're my best friend forever! I don't know why I just said that! Anyway, too much information! Why do I always give people too much information! I don't know ! Alright talk to you later bye best friend forever! Support these abbreviations: BFF -- best friend forever IDK - I don't know JK -- just kidding TMI -- too much information TTYL -- talk to you later Use the predefined constants for each abbreviation BFF, IDK, etc. and each long form BFF_LONG, IDK_LONG, etc. rather than hardcoding strings inside the loop DE 00 CH texting.cpp texting.cpp No Selection 1 \/ TODO (1): includesamespace declaration 2 3 4 5 const string BFF = "BFF"; const string IDK = "IDK"; const string JK = "UK"; const string TMI = "TMI"; const string TTYL = "TTYL"; 6 7 8 9 const string BFF_LONG = "best friend forever"; 10 const string IDK_LONG = "I don't know"; 11 const string JK_LONG = "just kidding"; 12 const string TMI_LONG = "too much information"; 13 const string TTYL_LONG = " talk to you later"; 14 15 int main() 16 { 17 //TODO (2): declare a string to hold the sentence 18 19 //TODO (3): prompt the user input "Enter text:" 20 21 //TODO (4): declare a variable to hold a search index 22 //TODO (5): implement a find and replace while loop for each abbreviation (5 total) 24 25 //TODO (6): use a for loop to iterate through each character of the string and replace any '.' with '!' //TODO (6): output the modified string 28 return 0; 30 } 23 26 27 29 31

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago