Assignemnt #125

Code

//colin hinton
//5th period
//ask.java
//5/12/2016

import java.io.File;
import java.util.Scanner;
class ask
{
    public static void main (String [] args) throws Exception
    {
        Scanner kb = new Scanner(System.in);
        System.out.println("Which file you want: ");
        String imput = kb.next();
        int a,b,c;
        
        Scanner fileIn = new Scanner(new File( (String)imput ));
        
        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();
        
        fileIn.close();
        
        System.out.println(a + " + " + b + " + " + c + " = " + (a+b+c));
    }
}

    

Picture of the output

Assignment 1