Echo! Echo!
If you have extra time, try to work on this optional exercise on your own or in lab.
What to do
For this exercise, write a program that
simply echoes every line the user enters until the enter a line that
is just the word "quit" at which point the program should exit.
The program should start by printing "ready" to indicate that it is
ready for input.
You should use input.nextLine() to read an entire input
line, where input is a reference to
a Scanner object.
Here is a sample execution. The user input is in bold.
os-prompt%java Echo
ready
This is a test.
This is a test.
Here is another line.
Here is another line.
quit
os-prompt%
|