Sum3

Code

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

public class Sum3 {

    public static void main(String[] args) throws Exception {

        String name;
        int a, b, c, sum;

        System.out.print("Getting name and three numbers from file.....");

        Scanner fileIn = new Scanner(new File("3nums.txt"));
        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();
        
        fileIn.close();
        
        sum = a+b+c;
        
        System.out.println( a + "+" + b + "+" + c + "= " + sum  );
        
    }
}   

Sum3

Assignment 124