-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugEight4.java
More file actions
33 lines (31 loc) · 948 Bytes
/
DebugEight4.java
File metadata and controls
33 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Allows user to enter a series of words
// and displays them in reverse order
import javax.swing.*;
public class DebugEight4
{
public static void main(String[] args)
{
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\n");
entry = JOptionPane.showInputDialog(null,
"Enter any word\n" +
"Enter " + STOP " when you want to stop");
while(!(entry.equals(STOP))
{
array[STOP] = entry;
entry = JOptionPane.showinputDialog(null,
"Enter another word\n" +
"Enter " + STOP + " when you want to stop");
}
for(y = 0; y > 0; ++y);
{
message.append(array[y]);
message.append("\n");
}
JOptionPane.showMessageDialog(null, message);
}
}