import java.util.Scanner; public class SMSTranslator { public static void main(String[] args) { Scanner console = new Scanner(System.in); String getAbbreviation = ""; { String BFF = "The translation is Best Friends FOREVER!!! :-)"; String BTE = "The translation is Blew The Exam :-("; String STT = "The translation is Spill The Tea ;-)"; getAbbreviation = console.next(); System.out.print("Enter SMS abbreviation: "); public Class.decode Abbreviation(console) if (getAbbreviation.compareTo("BFF") == 0) { System.out.println(BFF); } else if (getAbbreviation.compareTo("BTE") == 0) { System.out.println(BTE); } else if (getAbbreviation .compareTo("STT") == 0) { System.out.println(STT); // if input is out of dictonary } else{ System.out.println("The translation is "); } } } } Fix following error
import java.util.Scanner;
public class SMSTranslator {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
String getAbbreviation = "";
{
String BFF = "The translation is Best Friends FOREVER!!! :-)";
String BTE = "The translation is Blew The Exam :-(";
String STT = "The translation is Spill The Tea ;-)";
getAbbreviation = console.next();
System.out.print("Enter SMS abbreviation: ");
public Class.decode Abbreviation(console)
if (getAbbreviation.compareTo("BFF") == 0) {
System.out.println(BFF);
} else if (getAbbreviation.compareTo("BTE") == 0) {
System.out.println(BTE);
} else if (getAbbreviation .compareTo("STT") == 0) {
System.out.println(STT);
// if input is out of dictonary
} else{
System.out.println("The translation is <unknown abbreviation>");
}
}
}
}
Fix following error
Step by step
Solved in 2 steps with 5 images