Assignemnt #125

Code

/// Name: Ryan Volko
/// Period: 7
/// Program Name: Any
/// File Name: Any.java
/// Date Finished: 5/18/2016
import java.io.File;
import java.util.Scanner;

public class Any {

    public static void main(String[] args) throws Exception {
 Scanner kb = new Scanner(System.in);
 
        String file;
        int a, b, c, sum;

        System.out.print("Which File do you want? ");
        file = kb.next(); 

        Scanner fileIn = new Scanner(new File(file));

        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();
        


        sum = a + b + c;
        System.out.println(a + " + " + b + " + " + c + " = " + sum);
    }
}
    

Picture of the output

Assignment 125