Assignemnt #123 Simple File Input

Code

    /// Name: Drew Boxold
    /// Period 5
    /// Program Name: SimpleFileInput
    /// File Name: SimpleFileInput.java
    /// Date Finished: 5/31/16
    

import java.util.Scanner;
import java.io.File;

public class SimpleFileInput
{
    public static void main(String[] args) throws Exception
    {
        Scanner fileIn = new Scanner(new File("name.txt"));
        
        String firstname = fileIn.next();
        String lastname = fileIn.next();
        
        fileIn.close();
        
        System.out.println("\nUsing my psychic powers (aided by reading data from the file), I have ");
        System.out.print("determined your name is: " + firstname + " " + lastname + ".\n\n");
    }
}
    
    

Picture of the output

Assignment 41