In 3.15 Program: Text message expander (Java) Im stuck on one thing everything else is righ,t here is my code.  import java.util.Scanner; public class TextMsgExpander { public static void...


In 3.15 Program: Text message expander (Java) Im stuck on one thing everything else is righ,t here is my code.  import java.util.Scanner; public class TextMsgExpander { public static void main(String[] args) { /* Type your code here. */  String textMsg; String BFF="best friend forever";  String IDK="I don't know";  String JK="just kidding"; String TMI="too much information";      String TTYL="talk to you later";    System.out.println("Enter text: ");      Scanner scnr = new Scanner(System.in); textMsg=scnr.nextLine();    System.out.println("You entered: "+textMsg);   if(textMsg.contains("BFF"))    { textMsg=textMsg.replace("BFF",BFF); System.out.println("Replaced \"BFF\" with \"" + BFF + "\"" + "."); }if(textMsg.contains("IDK")) {textMsg=textMsg.replace("IDK",IDK); System.out.println("Replaced \"IDK\" with \"" + IDK + "\"" + ".");} if(textMsg.contains("JK")) {textMsg=textMsg.replace("JK",JK); System.out.println("Replaced \"JK\" with \"" + JK + "\"" + "."); } if(textMsg.contains("TMI")) {textMsg=textMsg.replace("TMI",TMI);

System.out.println("Replaced \"TMI\" with \"" + TMI + "\"" + "."); }if(textMsg.contains("TTYL")) {textMsg=textMsg.replace("TTYL",TTYL);

System.out.println("Replaced \"TTYL\" with \""+ TTYL + "\"" + "."); }System.out.println("Expanded: "+textMsg);}}     The top part is mine but the bottom part is what it wants how do I add the spaces there?


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here