Assignemnt #124

Code

          /// Name: Holden Ganch
          /// Period: 7
          /// Program Name:  Fourty first Program
          /// File Name: Using.java
          /// Date Finished: 11/3/2015


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

public class NumsFile {

    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("3nums.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