Advertisement
Guest User

challenge

a guest
Oct 10th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Start with the supplied code template, editing the top of program comment to include your FULL NAME.
  2.  
  3. Extend the template code as follows:
  4.  
  5. (1) Use nextLine() with your Scanner object variable to get one line of user input into a string (no prompt necessary).
  6. Output the line.
  7.  
  8. Example:
  9.  
  10. Enter text:
  11. IDK if I'll go. It's my BFF's birthday.
  12. You entered: IDK if I'll go. It's my BFF's birthday.
  13.  
  14. (2) Search the string (using indexOf()) to find the common abbreviations listed below
  15. and print a list of each found abbreviation along with its decoded meaning.
  16. NOTE: Each abbreviation will appear no more than once in the text.
  17.  
  18. Example:
  19.  
  20. Enter text:
  21. IDK if I'll go. It's my BFF's birthday.
  22. You entered: IDK if I'll go. It's my BFF's birthday.
  23. BFF: best friend forever
  24. IDK: I don't know
  25. Support these abbreviations (searching for them, in the order listed):
  26. BFF -- best friend forever
  27. IDK -- I don't know
  28. JK -- just kidding
  29. LOL -- laughing out loud
  30. TTYL -- talk to you later
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement