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
Which of the following statement about CAD is NOT true A. It increase the productivity of designers B. It uses computer graphics
Sedaia [141]

Answer:

D. All are true.

Explanation:

All the given statements about CAD are true.

5 0
3 years ago
Choose ALL guidelines listed below pertaining to fair use.
tino4ka555 [31]

Answer:

Introduction

As you write blog posts, you may find that you want to include images you find online. Or maybe you found a great piece of writing—a recipe, a story, or a review—that you want to highlight on your own blog. It's important to know that almost all of the content you find on the Web belongs to someone. Just because you can take images, text, and more from other sites doesn't mean it's right to do so—ethically or legally.

In this lesson, you'll learn about the copyright protections that apply to work posted online. You'll learn about the rules that determine which images and text you can use, and how you can use them. You'll also learn how to protect the content you create.

The laws discussed in this lesson are United States laws. No lawyer was involved in preparing this lesson. We are not legal experts, and this lesson should not be taken as legal advice.

Understanding copyright

Copyright is the legal concept that works—art, writing, images, music, and more—belong to the people who create them. According to copyright law, any original content you create and record in a lasting form is your own intellectual property. This means other people can't legally copy your work and pretend it's their own. They can't make money from the things you create either.

To use, copy, or change a copyrighted work, you need permission from the person who holds the copyright. This permission is called a license. Even though everyone has the right to require that others respect their copyright and ask permission to use their work, some people and organizations choose to license their content more freely. They do this by giving their work a Creative Commons license or by placing their work in the Public Domain.

6 0
3 years ago
Read 2 more answers
On what menu in Microsoft Word can you locate the Macro feature?
Harrizon [31]

Answer:

View

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

In Microsoft Word 2019, the users are availed with the ability to edit the word document in the following view type;

I. View Mode

II. Print Mode

III. Drift Layout

The Microsoft Word developers has made it easy for their users to automate the tasks used frequently through the creation and execution of macros.

Basically, macros comprises of commands and instructions which may be grouped together as a single command to automatically execute a task. You can locate the Macro feature in the View tab of Microsoft Word.

6 0
3 years ago
Your motherboard supports dual channeling and you currently have two slots populated with DIMMs; each module holds 2 GB. You wan
Olenka [21]
One 4-GB DIMM. Dont really have a explanation for it just comes from previous experience
6 0
3 years ago
Read 2 more answers
What was the strategy the company adopted for ERP implementation?
SashulF [63]

Answer:

Big Bang or Phased Approach – ERP Implementation strategies include Big Bang, Phased, Hybrid, and Parallel Adoption. Each organization requirements are different and as such, the project management method is itself evolving using PPM, SCRUM, and DevOps.

8 0
2 years ago
Other questions:
  • Ron is creating building blocks in Word. How can he make the building blocks that he created available?
    11·2 answers
  • Assume you have a sorting algorithm that you can use as a black box. Use the sorting algorithm to sort the input list. Now write
    10·1 answer
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • Question 2 of 5
    8·1 answer
  • The "Rudolph Rule" is best described by which of the following?
    9·1 answer
  • . What type of computer implementation does the following code represent? Load A,10 Load B,1:5 Add A,B STORE A, [20]
    5·1 answer
  • Can someone help I think I know it but I wanna make sure I’m right
    10·1 answer
  • Which best describes how a supporting database will be structured?
    10·1 answer
  • Which one you choosing? PS5 OR THE XBOX SERIES X???
    14·2 answers
  • ________ is a group meeting-based process for requirements collection. a. Reverse engineering b. Joint application design c. Hum
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!