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
Flexplace and telecommuting are similar in that both allow you to _____. work in a location away from the office work different
viva [34]
Flexplace and telecommuting are similar in that both allow you to work in a different location four days a week. 
3 0
3 years ago
In what year was the first world-wide web software created by tim berners-lee?
Elena L [17]
1989 <span>A graduate of Oxford University, Tim Berners-Lee invented the Web while at CERN, the European Particle Physics Laboratory, in </span>1989<span>. He wrote the first web client and server in </span>1990<span>.</span>
6 0
3 years ago
(3)(6 Points) During a sale at a store, a 10% discount is applied to purchases over $10.00. Write a program that asks for the am
Galina-37 [17]
I only need point sort
7 0
2 years ago
The best answer it requests services, data and other resources available on the server​
Brilliant_brown [7]

Answer:

Explanation:

?

6 0
2 years ago
Read 2 more answers
Identify the components of the enveloped virus budding process
Elina [12.6K]

The components of the enveloped virus budding process are:

  • lipid bilayers
  • fission event
  • Glycosylated (trans-) membrane proteins.

<h3>What is the case of the virus about?</h3>

Virus budding in general is known to be a term that connote the scattering or disturbance of a cellular membrane and it is one away from the cytoplasm.

Note that it is said to be the envelopment of the viral capsid and this is done by one or more lipid bilayers that can be seen in the viral membrane glycoproteins, and it is one where a fission event takes place.

Hence The components of the enveloped virus budding process are:

  • lipid bilayers
  • fission event
  • Glycosylated (trans-) membrane proteins.

Learn more about virus from

brainly.com/question/26128220

#SPJ1

3 0
1 year ago
Other questions:
  • The following code should take a number as input, multiply it by 8, and print the result. In line 2 of the code below, the * sym
    7·1 answer
  • Consider the following sequence, defined from n=2 to 15 (inclusive). Pn=n2−1. Produce a list named primes which only contains va
    10·1 answer
  • What version of ubuntu is linux mint 17.3 based on?
    14·1 answer
  • Options to rotate cells in excel are available using the _____ button in the alignment group on the home tab.
    10·1 answer
  • The network architecture component that is a special LAN with a group of servers that enables electronic data exchange of betwee
    8·1 answer
  • The scene of a human sitting at a computer terminal, responding to stimuli flashed on the computer screen, would most likely be
    7·1 answer
  • 10. Question<br> What are the drawbacks of purchasing something online? Check all that apply.
    5·1 answer
  • What will the following program display in the console?
    12·1 answer
  • At the heart of every computing device is a(n) _______________, which is usually a single, thin wafer of silicon and tiny transi
    12·1 answer
  • Tim is a project manager. He is brainstorming with his team about problems that could arise during the next phase of the project
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!