Assignment #124

   ///Name: Sam Wilson
   ///Period: 6
   ///Program Name: Summoning Three Numbers From a File
   ///File Name: summon3.java
   ///Date Finished: 5/30/16
    
    
  import java.io.File;
    import java.util.Scanner;
    
    public class summon3
    {
        public static void main (String[] args) throws Exception
        {
            int a, b, c, sum;
            
            System.out.println( "Reading numbers from file \"3nums.txt\" .... " );
            
            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 );
        }
    }
    

Picture of the output

Assignment #124 Assignment #124