Answer:
See explaination
Explanation:
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String line;
while (true) {
line = in.nextLine();
if (line.equals("quit") || line.equals("Quit") || line.equals("q")) break;
for (int i = 0; i < line.length(); i++) {
System.out.print(line.charAt(line.length() - i - 1));
}
System.out.println();
}
}
}