Question
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
// Application allows user to enter a series of words
// and displays them in reverse order
import java.util.*;
public class DebugEight4
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int x = 0, y;
String array[] = new String[100];
String entry;
final String STOP = XXX;
StringBuffer message = new
StringBuffer("The words in reverse order are");
System.out.println("Enter any word" +
"Enter + STOP + when you want to stop");
entry = input.next();
while(!(entry.equals(STOP)))
{
array[x] = entry;
++x;
System.out.println("Enter another word" +
"Enter " + STOP + " when you want to stop");
entry = input.next();
}
for(y = x - 1; y > 0; ++y)
{
message.append(array[y]);
message.append("");
}
System.out.println(message)
}
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
Working Code without errors import javautil public class DebugEight4 public static void mainString a...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started