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
How does a cat get out of a bush?
Alex17521 [72]

Answer:

that lil mf crawls through the bush

Explanation:

hes fast ngl

7 0
3 years ago
What is the difference between a learner’s license and a driver’s license?
kirill115 [55]

privilege to operate a motor vehicle-drivers License

Able to get when 15. Valid for 1 yr. Allows you to drive with a parent in the car. $15. Bring social security and birth certificate to the DLD. Have for 6 months (and do 40 hrs) before getting license.-Learner Permit

4 0
2 years ago
Choose the statements that CORRECTLY describe a business organization.​
Kryger [21]

Answer:

An advantage to Corporations aI's a business organization is that they enjoy unlimited life and limited liability.

Explanation:

Unlimited life and limited liability are the major advantages of corporations.

Corporations have unlimited life unless all the shareholders decides to dissolve the corporation.

It has limited liability, it means that only the company assets will be sold in case of debt and investors are not liable to pay the debt.

3 0
3 years ago
How do we benefit from this increased interconnectivity?
ankoles [38]
Well we just benefit from it like it just helps as I guess
8 0
2 years ago
If you’re the victim of cyber bullying behavior, besides contacting your teacher or the school, where else can you go to find in
RideAnS [48]

parents

childline

ceop

family

3 0
3 years ago
Other questions:
  • As a compositional mode for electronic? media, __________ help people find their way through an unfamiliar system or? subject; t
    7·1 answer
  • There is an application which inputs hundred numbers from the user, if user enters a positive number it increments valid numbers
    6·1 answer
  • Jeremy is designing a website for a florist. He intends to discuss the web design with his client. Which tool should Jeremy use
    6·1 answer
  • A communications objective is:
    12·1 answer
  • If your vehicle leaves the pavement for any reason, remember to take your foot off the gas pedal, hold the wheel firmly, and____
    8·2 answers
  • Write a program that prompts the user to enter a number then counts the number of odd numbers and even numbers the user enter. T
    15·1 answer
  • How ssd is better than normal sata and pata HDD​
    11·1 answer
  • A new user needs access to their files in iCloud without relying on the operating system (OS). How would the user access the App
    13·1 answer
  • List at least 5 features that can be used to format a report.
    11·1 answer
  • True or false FAFSA awards work study, but jobspeaker can be used to learn which jobs are available
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!