3.17 Ch 3 Program: Text message decoder (Java)

(1) Use scnr.nextLine() to get a line of user input into a string. Output the line. (3 pts)

Ex:

Enter text: IDK if I’ll go. It’s my BFF’s birthday. You entered: IDK if I’ll go. It’s my BFF’s birthday.

(2) Search the string (using indexOf()) for common abbreviations and print a list of each found abbreviation along with its decoded meaning. (3 pts)

Ex:

Enter text: IDK if I’ll go. It’s my BFF’s birthday. You entered: IDK if I’ll go. It’s my BFF’s birthday. BFF: best friend forever IDK: I don’t know

Support these abbreviations:

BFF — best friend forever

IDK — I don’t know

JK — just kidding

TMI — too much information

TTYL — talk to you later

Code will be typed in “Type your code here”:

import java.util.Scanner;

public class TextMsgDecoder {
   public static void main(String[] args) {
      /* Type your code here. */
     
      return;
   }
}



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *