Assignment #124

Code

    /// Name: Matthew Lorence
    /// Period: 5
    
    import java.io.File;
    import java.util.Scanner;
    
    public class SummingThree {
    
        public static void main(String[] args) throws Exception {
    
            String name;
            int a, b, c, sum;
    
            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