Question
IN JAVA For abbreviations that do not match the supported abbreviations, check for common misspellings. Provide a suggestion for correct abbreviation along with the decoded
IN JAVA
For abbreviations that do not match the supported abbreviations, check for common misspellings. Provide a suggestion for correct abbreviation along with the decoded meaning.
Example:
If the user enters "LLO", your program will print Did you mean LOL? LOL = laughing out loud (end with a new line)
import java.util.Scanner;
public class TweetDecoder {
public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String origTweet = "";
System.out.println("Enter abbreviation from tweet: "); origTweet = scnr.next(); System.out.println("You entered " + origTweet); /* FIXME: Add all the possible misspellings for each of the supported abbreviations. Note the number of combinations for each 3-letter abbreviation? */ if (origTweet.equals("LOL")) { System.out.println("LOL = laughing out loud"); } else if (origTweet.equals("BFN")) { System.out.println("BFN = bye for now"); } else if (origTweet.equals("FTW")) { System.out.println("FTW = for the win"); } else if (origTweet.equals("IRL")) { System.out.println("IRL = in real life"); } else { System.out.println("Sorry, don't know that one."); } return; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started