Question

(SMS Language) Short Message Service (SMS) is a communications service that allows sending text messages of 160 or fewer characters between mobile phones. With the proliferation of mobile phone use worldwide, SMS is being used in many developing nations for political purposes (e.g., voicing opinions and opposition), reporting news about natural disasters, and so on.
Since the length of SMS messages is limited, SMS Language—abbreviations of common words and phrases in mobile text messages, emails, instant messages, etc.—is often used.
For example, “in my opinion” is “imo” in SMS Language.
Research SMS Language online. Write a GUI application in which the user can enter a message using SMS Language, then click a button to translate it into English (or your own language).
Also provide a mechanism to translate text written in English (or your own language) into SMS Language. One potential problem is that one SMS abbreviation could expand into a variety of phrases.
For example, IMO (as used above) could also stand for “International Maritime Organization,” “in memory of,” etc.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import javax.swing.JList;
import javax.swing.JOptionPane;

/**
*
* @author
*/
public class Main {
   
    static ArrayList< String > sms = new ArrayList< String >();
    static ArrayList< String > meaning = new ArrayList< String >();
   
    public static void readDictionary()
    {
       File file = new File("dictionary.txt");
       boolean flag = false;
      
       try {

            Scanner scanner = new Scanner(file);
            flag = true;
            String delims = ":";
            String line;
            while (scanner.hasNextLine()) {
                line = scanner.nextLine();
            //    System.out.println(line);
                String[] tokens = line.split(delims);
               sms.add(tokens[0]);
               meaning.add(tokens[1].toLowerCase());
            }
            scanner.close();
       } catch (FileNotFoundException e) {
            e.printStackTrace();
       }
    }
   
    static String S2E(String message)
    {
       String m = message.toUpperCase();
       for (int i = 0; i < sms.size(); i++) {
            if (m.equals(sms.get(i))) {
                return meaning.get(i);
            }
       }
       return message;
    }...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Java Problems: Student Details & Fibonacci Series
Homework Solution
$20.00
Java
Programming
OOP
Computer Science
Fibonacci Series
Students
Classes
Instances
Loops
Conditions
Statements
Variables
Integers
Mathematics
Java Project: Right Triangle Of Stars
Homework Solution
$30.00
Java
Programming
Computer Science
Mathematics
Loops
Input
Output
Conditions
Right Triangle
Base
Hypotenuse
Stars
Statements
Variables
Even Numbers
Odd Numbers
Transformations
Java Programming Problems
Homework Solution
$38.00
Java
Programming
Algorithms
Computer Science
Prime Numbers
Deadpool
Characters
Colossus
Odd Numbers
Random Values
Palindromes
Specifications
Statements
Variables
Functions
ChatBot Using Java Programming
Homework Solution
$7.00
Java
Programming
Coding
Chatting
Bot
Users
Computers
Sentences
Symbols
Instant Messaging
Input
Output
Special Characters
Even Numbers
Odd Numbers
Java Programming: Strings, Odd & Even Numbers, Absolute Values
Homework Solution
$25.00
Java
Programming
Computer Science
Odd Numbers
Even Numbers
Integers
Absolute Values
While Loop
IF-Statements
Data Sets
Input
Output
Sum
Functions
Methods
Strings
Lexicography Order
Get help from a qualified tutor
Live Chats