Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... 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

Managerial Accounting

Authors: Ray H. Garrison, Eric W. Noreen, Peter C. Brewer

13th Edition

978-0073379616, 73379611, 978-0697789938

More Books

Students also viewed these Accounting questions

Question

What is the shape of the exponential distribution?

Answered: 1 week ago

Question

4. How does a sex-linked gene differ from a sex-limited genepg78

Answered: 1 week ago