Assignemnt #124

Code

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

public class Sum {

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

      
        int a, b, c, sum;

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

        Scanner fileIn = new Scanner(new File("numbers.txt"));

        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 124