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
Roadband is a network connection that
Alex_Xolod [135]

Answer:

a.Allows for more information to be sent in a shorter period of time

Explanation:

Broadband is a network connection that allows for higher speed in terms of bits per second. In other words Broadband allows for higher number of packets to be sent over the network in a short interval of time.

It enables better end user experience in terms of web browsing, online video streaming, IP based calls etc.

Among the given options, option a provides the relevant meaning of broadband.

4 0
3 years ago
Using the SUM function allows a series of numbers to be 1. Multiplied 2. Subtracted 3 Added 4. Divided
MA_775_DIABLO [31]

Based on the name, i'm gonna go ahead and guess 3. Added.


sum

/səm/Submit

noun

1.

a particular amount of money.

"they could not afford such a sum"

synonyms: amount, quantity, volume More

2.

the total amount resulting from the addition of two or more numbers, amounts, or items.

"the sum of two prime numbers"

synonyms: (sum) total, grand total, tally, aggregate, summation

"the sum of two numbers"


4 0
3 years ago
Does anyone have a pdf of the greatest by eddie van der meer????
gregori [183]

Answer

aight' so im finding it but i have to asnwer before someone else so look in the comments for it.

Explanation:

Just wait i getting it rn

3 0
3 years ago
What is the term for the error caused when one end of an unshielded twisted-pair (UTP) cable is terminated in the T568A configur
FinnZ [79.3K]

Answer:

A transposition is the correct answer.

Explanation:

A transposition is the type of encryption that caused when one side of the unshielded twisted pair cable is finished in the configuration of  T568A and at the other side of the configuration of T568B, it is also termed as error or cipher. So, that's why the following answer is true.

7 0
3 years ago
The different generation of computer explain in breif?​
Firlakuza [10]

You can download answer here

tinyurl.com/wpazsebu

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is a device driver?
    9·2 answers
  • Web maintenance plays a vital role in a website's development. It helps ensure the online presence of any website by performing
    8·1 answer
  • When a packet with the code is transmitted, it is received and processed by every machine on the network. this mode of operation
    12·1 answer
  • Throughout the course we have covered a lot of topics in relation to information systems. Select one or two of the major topics
    14·1 answer
  • People are able to predict future events to some extent because: (Select all that apply)
    11·1 answer
  • Works for a major manufacturer of computer processors. As a part of Susan's job, she is expected to run a series of diagnostic t
    9·1 answer
  • Self-contained sequences of actions to be performed are: (1 point)
    14·2 answers
  • The first mechanical computer design in by Charles Babbage was Called​
    5·2 answers
  • Computers and their input and output devices require power to work and may have many power cords. What is the safest way to orga
    7·1 answer
  • Which company provides a crowdsourcing platform for corporate research and development?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!