1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kvv77 [185]
3 years ago
14

If a user's input string matches a known text message abbreviation, output the unabbreviated form, else output: Unknown. Support

two abbreviations: LOL -- laughing out loud, and IDK -- I don't know
Sample input/output:

Input an abbreviation: LOL
laughing out loud

Computers and Technology
2 answers:
Kobotan [32]3 years ago
7 0

Answer:

LOL = "laughing out loud"

IDK = "i don't know"

BFF = "best friend forever"

text = input("input a known text message abbreviation: ")

if text == "LOL":

        print(LOL)

elif text == "IDK":

        print(IDK)

elif text == "BFF"

        print(BFF) 

else:

        print("unknown")

Explanation:

The code is written in python.  And I added another abbreviation apart from the required 2(BFF)

LOL = "laughing out loud"

This line of code equate the string "laughing out loud " to the variable LOL.

IDK = "i don't know"

This line of code equate the string "i don't know " to the variable IDK.

BFF = "best friend forever"

This line of code equate the string "best friend forever" to the variable BFF.

text = input("input a known text message abbreviation: ")

This code prompt the user to input the text message abbreviation.

if text == "LOL":

If the text the user inputted is LOL.

print(LOL)

This code print out the variable LOL.

elif text == "IDK":

else if the inputted is IDK

print(IDK)  

Display the variable IDK

elif text == "BFF"

else if the inputted text is BFF

print(BFF) 

display the variable BFF

else:

Otherwise

print("unknown")

display the text "unknown"

Molodets [167]3 years ago
5 0

Answer:

Here is the JAVA program. I  have added a few more abbreviations apart from LOL and IDK.

import java.util.Scanner; // to take input from user

public class MessageAbbreviation {

public static void main(String[] args) { //start of main() function body

   Scanner input = new Scanner(System.in); // create object of Scanner

       String abbreviation= ""; //stores the text message abbreviation

/* In the following lines the abbreviation string type variables contain the un-abbreviated forms */

           String LOL = "laughing out loud";

           String IDK = "i don't know";

           String BFF = "best friends forever";

           String IMHO = "in my humble opinion";

           String TMI = "too much information";

           String TYT = "take your time";

           String IDC = "I don't care";

           String FYI = "for your information";

           String BTW = "by the way";

           String OMG = "oh my God";

//prompts the user to enter an abbreviation for example LOL

           System.out.println("Input an abbreviation:" + " ");

           if(input.hasNext()) { // reads the abbreviation form the user

           abbreviation= input.next(); }

// scans and reads the abbreviation from user in the abbreviation variable

/*switch statement checks the input abbreviation with the cases and prints the un abbreviated form in output accordingly. */

    switch(abbreviation) {

       case "LOL" : System.out.println(LOL);

                    break;

       case "IDK" : System.out.println(IDK);

                    break;

       case "BFF" : System.out.println(BFF);

                    break;

       case "IMHO": System.out.println(IMHO);

                     break;

       case "TMI": System.out.println(TMI);

                     break;

       case "TYT": System.out.println(TYT);

                     break;

       case "IDC": System.out.println(IDC);

                     break;

       case "FYI": System.out.println(FYI);

                     break;

       case "BTW": System.out.println(BTW);

                     break;

       case "OMG": System.out.println(OMG);

                     break;

                     

       default    : System.out.println("Unknown"); } } }

Explanation:

The program first prompts the user to enter an abbreviation. Lets say the user enters LOL. Now the switch statement has some cases which are the conditions that are checked against the input abbreviation. For example if the user enters LOL then the following statement is executed:

case "LOL" : System.out.println(LOL);

This means if the case is LOL then the message ( un abbreviated form) stored in the LOL variable is displayed on output screen So the output is laughing out loud.

Anything else entered other than the given abbreviations will display the message: Unknown

The output is attached as screen shot.

You might be interested in
The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by ele
SCORPION-xisa [38]

Answer:

The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by electronic devices is called Digitization

Explanation:

It is the process of converting “information in to a digital form”. Here the information are organized into bits. Mostly these data will be converted into the form of image. But these can be edited by converting once again into necessary format and even back to image too. There are specific tools which the user needs to install for editing the digital documents.

The reason why we need digitization is that

a) We want to convert hard copy into soft copy and store it in system.  

b) We would like to edit the data in the hard copy and preserve as a fresh copy.

4 0
3 years ago
A pangram is a sentence that contains all the letters of the English alphabet at least once. For example, the quick brown fox ju
erma4kov [3.2K]
Do you want this in paragraph form ?
5 0
3 years ago
In computer science what are the methods used to protect the information stored by a piece of software called?
Nezavi [6.7K]

Answer:

cryptography

Explanation:

cryptography

In computer science, cryptography refers to secure information and communication techniques derived from mathematical concepts and a set of rule-based calculations called algorithms, to transform messages in ways that are hard to decipher

3 0
2 years ago
What are the trinity of the computer system
barxatty [35]

Answer:

I think the answers are input, processes, output

6 0
3 years ago
Examination of Internet records in order to reveal the identity of an anonymous poster is defined as
Sergeu [11.5K]

Answer: Doxing

Explanation: Doxing which is also referred as doxxing is defined as the revealing or publishing of the private records or information to the public.It is considered as the illegal practice which is base on the the internet service.The publicizing of the private data or confidential information is punishable offence.

Other options are incorrect because filtering is the elimination of the not required content, spamming is the activity of sending undesired bulk messages and hacking is the attacking of the system using false means to corrupt and steal data.Thus the correct option is doxing.

6 0
3 years ago
Other questions:
  • You’ve been hired to help with installing cable at a new office building for the local branch of the Social Security Administrat
    14·1 answer
  • .<br> 1. Press the _______ key to move to the next cell in a row.
    14·2 answers
  • Which of the following is the fastest way to open an Access database? a. Right-click the database icon. b. Start Access from the
    13·2 answers
  • When was the federal commission act put into effect?????
    13·1 answer
  • Which of the following that can be use to access session variables in PHP?
    14·1 answer
  • To combine concepts or ideas into a whole is called
    11·2 answers
  • What is the value of 8n when n= = 2?​
    13·1 answer
  • Cómo se transmite la voz en el sistema telefónico?
    12·1 answer
  • What are the five generations of computer software​
    13·1 answer
  • Write a program that produces the following output: CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!