(1) Use scnr.nextLine(); to get a line of user input into a string. Output that line. Ex: Enter text (enter quit to quit): IDK how that happened. TTYL. You entered: IDK how that happened. TTYL. (2) Expand common text message abbreviations. Output a message for each abbreviation that is expanded, then output the expanded line. Note: Check for abbreviations in the order provided below. Support these abbreviations: BFF -- best friend forever IDK -- I don't know JK -- just kidding TMI -- too much information TTYL -- talk to you later Ex: Enter text (enter quit to quit): 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. (3) Now make the program repeatedly ask the user to enter a text until the user decides to quit. User should enter "quit" to quit. Ex: Enter text (enter quit to quit): 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. Enter text (enter quit to quit): IDK. TMI. You entered: IDK. TMI. Replaced "IDK" with "I don't know". Replaced "TMI" with "too much information". Expanded: I don't know. too much information. Enter text (enter quit to quit): quit This is the end of the program.
(1) Use scnr.nextLine(); to get a line of user input into a string. Output that line.
Ex:
Enter text (enter quit to quit):
IDK how that happened. TTYL.
You entered: IDK how that happened. TTYL.
(2) Expand common text message abbreviations. Output a message for each abbreviation that is expanded, then output the expanded line. Note: Check for abbreviations in the order provided below.
Support these abbreviations:
- BFF -- best friend forever
- IDK -- I don't know
- JK -- just kidding
- TMI -- too much information
- TTYL -- talk to you later
Ex:
Enter text (enter quit to quit):
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.
(3) Now make the program repeatedly ask the user to enter a text until the user decides to quit. User should enter "quit" to quit.
Ex:
Enter text (enter quit to quit):
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.
Enter text (enter quit to quit):
IDK. TMI.
You entered: IDK. TMI.
Replaced "IDK" with "I don't know".
Replaced "TMI" with "too much information".
Expanded: I don't know. too much information.
Enter text (enter quit to quit):
quit
This is the end of the program.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images