Assignemnt #125 Summoning Three Numbers From Any File

Code

    ///Name: Joshua Pell
    ///Period: 6
    ///Project Name: Summoning Three Numbers From Any File
    ///File Name: threeanyfile.java
    ///Date: 5/31/2015
    
import java.util.Scanner;
import java.io.File;

public class threeAnyFile
{
    public static void main( String[] args ) throws Exception
    {
        String whichFile;
        int a, b, c;
        
        Scanner prompt = new Scanner( System.in );
        System.out.print( "Which file would you like to read numbers from: " );
        whichFile = prompt.next();
        System.out.println( "Reading numbers from file \"3nums2.txt\"" );
        System.out.println();
        Scanner fileIn = new Scanner( new File(whichFile));
        
                
        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();
        
        System.out.println( a + " + " + b + " + " + c + " = " + (a + b + c) );

    }
}
    

Picture of the output

Assignment 125