// Application allows user to enter a series of words // and displays them in reverse order import java.util.*; public class DebugEight4 { publicstaticvoidmain(String[] args) { Scanner input =newScanner(System.in); int x =0, y; String array[] =newString[100]; String entry; finalString STOP =XXX; StringBuffer message =new StringBuffer("The words in reverse order are\n");   System.out.println("Enter any word\n" + "Enter + STOP + when you want to stop"); entry = input.next(); while(!(entry.equals(STOP))) { array[x] = entry; ++x; System.out.println("Enter another word\n" + "Enter "+STOP+" when you want to stop"); entry = input.next(); } for(y = x -1; y >0; ++y) { message.append(array[y]); message.append("\n"); } System.out.println(message) }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
100%
// Application allows user to enter a series of words
// and displays them in reverse order
import java.util.*;
public class DebugEight4
{
publicstaticvoidmain(String[] args)
{
Scanner input =newScanner(System.in);
int x =0, y;
String array[] =newString[100];
String entry;
finalString STOP =XXX;
StringBuffer message =new
StringBuffer("The words in reverse order are\n");
 
System.out.println("Enter any word\n" +
"Enter + STOP + when you want to stop");
entry = input.next();
while(!(entry.equals(STOP)))
{
array[x] = entry;
++x;
System.out.println("Enter another word\n" +
"Enter "+STOP+" when you want to stop");
entry = input.next();
}
for(y = x -1; y >0; ++y)
{
message.append(array[y]);
message.append("\n");
}
System.out.println(message)
}


Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,