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 Programming: Printing The Pattern
Homework Solution
$10.00
Java
Programming
Computer Science
Loops
Printing
Patterns
Rows
Loops
Statements
Variables
Integers
Strings
Input
Output
Java Problems: Integers, Strings, File Management & Arrays
Homework Solution
$33.00
Java
Programming
Coding
Computer Science
Input
Output
File Management
Arrays
Integers
Average Values
Methods
Functions
Parameters
Declaration
Strings
Prime Numbers
Java Program With Lists & Integers
Homework Solution
$40.00
Java
Programming
Codes
Algorithms
Linked Lists
File Management
Data Structures
Libraries
Scanner
Zero Sum Subset
Input
Output
Statements
Variables
Positive Integers
Negative Integers
Binary Mask
Pseudo-Codes
Java Program With Strings & Integers
Homework Solution
$20.00
Java
Programming
Coding
Strings
Integers
Computer Science
Symbols
Special Characters
Reading
Writing
Rows
Columns
Statements
Conditions
Loops
Get help from a qualified tutor
Live Chats