Question: Please check the java project and correct it for me , thanks! * The program reads some text and convert the emoji letters to emojis.
Please check the java project and correct it for methanks!
The program reads some text and convert the emoji letters to emojis.
For each character in the text, do the following:
If c equals to h or H change it to a happy emoji
If c equals to a or A change it to an angry emoji
If c equals to s or S change it to a sad emoji
Otherwise, keep it unchanged
import java.util.Scanner;
public class AsciiToEmoji
public static void mainString args
Prepare a scanner for user input handling
Scanner scanner new ScannerSystemin;
The input line
String line ;
Keep asking for the input until it is equal to "bye"
do
System.out.printPlease enter a line of text enter 'bye' to quit the program: ;
Task : Read a line from the scanner object
line scanner.nextLine;
Task : Convert the emoji letters to emojis
if line.equalsbye
line line.replaceh:
replaceH:
replacea
replaceA
replaces:
replaceS:;
System.out.printlnline;
while line.equalsbye;
scanner.close;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
