Advertisement
Guest User

code

a guest
Oct 10th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1.  
  2. // Author: Kyle Quirk
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class TextMsgDecoder {
  7.    public static void main(String[] args) {
  8.       Scanner scnr = new Scanner(System.in);
  9.      
  10.       String userInput;
  11.       String userAcronym;
  12.      
  13.       System.out.println("Enter text:");
  14.       userInput = scnr.nextLine();
  15.      
  16.       System.out.println("You entered: " + userInput);
  17.       userInput = userInput.toUpperCase();
  18.      
  19.       if(userInput.substring(userInput.indexOf("BFF"), userInput.lastIndexOf("BFF")) == "BFF") {
  20.          System.out.println("BFF: best friend forever");
  21.          }
  22.       if(userInput.substring(userInput.indexOf("IDK"), userInput.lastIndexOf("IDK")) == "IDK") {
  23.             System.out.println("IDK: I don't know");
  24.       }
  25.       if(userInput.substring(userInput.indexOf("JK"), userInput.lastIndexOf("JK")) == "JK") {
  26.             System.out.println("JK: just kidding");
  27.       }
  28.       if(userInput.substring(userInput.indexOf("LOL"), userInput.lastIndexOf("LOL")) == "LOL") {
  29.             System.out.println("LOL: laughing out loud");
  30.       }
  31.       if(userInput.substring(userInput.indexOf("TTYL"), userInput.lastIndexOf("TTYL")) == "TTYL") {
  32.             System.out.println("TTYL: talk to you later");
  33.       }      
  34.      
  35.       return;
  36.    }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement