NumberList.java

The following text was written to the standard output stream when the ? program was executed from IntelliJ.

>>> help
HELP - display a menu of commands
DISPLAY - display the list of numbers
PRINT - print a number (FIRST;LAST;nth)
SWAP - exchange two elements (nth;mth)
ADD - add a number to the list (FIRST;LAST)
EXIT - terminate execution of the program
>>> display
10
12
11
4
7
5
9
56
2
3
8
5
>>> print first
10
>>> print last
5
>>> print 3
11
>>> print 10
3
>>> swap 8 9
>>> display
10
12
11
4
7
5
9
2
56
3
8
5
>>> swap 10 5
>>> display
10
12
11
4
3
5
9
2
56
7
8
5
>>> swap  1 18
>>> display
0
12
11
4
3
5
9
2
56
7
8
5
>>> help
HELP - display a menu of commands
DISPLAY - display the list of numbers
PRINT - print a number (FIRST;LAST;nth)
SWAP - exchange two elements (nth;mth)
ADD - add a number to the list (FIRST;LAST)
EXIT - terminate execution of the program
>>> add first 100
>>> add last 200
>>> shownumbers
### Unrecognizable command: shownumbers
>>> display
100
0
12
11
4
3
5
9
2
56
7
8
5
200
>>> exit