Displaying a File

Ask the user for the name of a file to open. Open that file, and display the entire contents of the file on the screen.

You must do this a line at a time using nextLine() and a loop that checks hasNext().

Open which file: score.txt
Mitchell
32767

 

Open which file: letter.txt
+---------------------------------------------------------+
|                                                    #### |
|                                                    #### |
|                                                    #### |
|                                                         |
|                                                         |
|                              Bill Gates                 |
|                              101 Microsoft Way          |
|                              Redmond, WA 78641          |
|                                                         |
+---------------------------------------------------------+


©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License