Assignemnt #127 and display
Code
///Name: Luke Shin
///Period: 7
///Project Name: display
///File Name: display.java
///Date: 04/05/2016
import java.util.Scanner;
import java.io.File;
public class display{
public static void main(String[] args) throws Exception{
int score;
String fileName = "";
Scanner keyboard = new Scanner(System.in);
while (!fileName.equals("exit"))
{
System.out.print("File name: ");
fileName = keyboard.next();
if (!fileName.equals("exit"))
{
System.out.print("Loading data from \"" + fileName + "\".....");
Scanner fileIn = new Scanner(new File(fileName));
System.out.println("Done");
System.out.println("============================================");
while(fileIn.hasNext())
{
System.out.println(fileIn.nextLine());
}
fileIn.close();
}
}
}
}
Picture of the output