Question
Any help would be appreciated (Java). This program will find known text message abbreviations within a string and replace them with their actual meanings in
Any help would be appreciated (Java).
This program will find known text message abbreviations within a string and replace them with their actual meanings in unabbreviated form.
(1) Implement for Test 1: Use nextLine() with a Scanner object variable to read one line of user input into a String variable. Output that line. Example:
Enter text: IDK how that happened. TTYL. You entered: IDK how that happened. TTYL.
(2) Implement for remaining tests: (Test 5 is a blind test) Expand the common text message abbreviations. Output a message for each abbreviation that is expanded, and use replace() on the input String to expand the abbreviation. After all replacements have been made, output the expanded line. NOTE: An abbreviation may appear more than once in the text, but you will only need to write code to search and replace once per abbreviation. Support these abbreviations (searching for them, in the order listed): BFF -- best friend forever IDK -- I don't know JK -- just kidding TTYL -- talk to you later
Example:
Enter text: IDK how that happened. TTYL. You entered: IDK how that happened. TTYL. Replaced "IDK" with "I don't know". Replaced "TTYL" with "talk to you later". Expanded: I don't know how that happened. talk to you later.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started