Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: Edit the TextMessageDecoder Java class to promt for a sentance with Enter text: then take the sentance with an abreviation such as IDK, BFF,

Objective: Edit the TextMessageDecoder Java class to promt for a sentance with Enter text: then take the sentance with an abreviation such as IDK, BFF, JK, TMI, TTYL, then print the sentance back to the screen and list the meaning of all the abreviations the user used below.

Example:

If the input is:

Enter text: IDK if I'll go. It's my BFF's birthday. 

Then the output will be:

You entered: IDK if I'll go. It's my BFF's birthday. BFF: best friend forever IDK: I don't know 

Some Notes on how you might approach this problem are below:

(1) Use scnr.nextLine() to get a line of user input into a string. Output the line.

Ex:

Enter text: IDK if I'll go. It's my BFF's birthday. You entered: IDK if I'll go. It's my BFF's birthday. 

(2) Search the string (using indexOf()) for common abbreviations and print a list of each found abbreviation along with its decoded meaning.

Ex:

Enter text: IDK if I'll go. It's my BFF's birthday. You entered: IDK if I'll go. It's my BFF's birthday. BFF: best friend forever IDK: I don't know 

Support these abbreviations:

  • BFF -- best friend forever

  • IDK -- I don't know

  • JK -- just kidding

  • TMI -- too much information

  • TTYL -- talk to you later

  • There are many files in this repository and we will go through what each of them does in class, but the only one you need to edit is TextMessageDecoder.java.

  • Each time you save your code in this repository a series of tests will be run against your code in a container. To see if your code passed all the tests and is ready to submit, go to the 'Actions' tab of your repository and see if the last commit passed all the tests. If it did, there will be a green checkmark by the last commit, otherwise there will be a red x.

  • If you're not sure why your commit didn't pass the tests, click into the commit in the actions tab and then click 'autograding'. You will be able to see the output of the test and use this to determine what went wrong. If you need help, post on Slack!

import java.util.Scanner;

public class TextMessageDecoder { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); /* Type your code here. */ }

} WRITTEN IN JAVA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions