Assignment 122, Data From A File

Code

   ///Name: Stella Koliavas
   ///Period: 5
   ///Program Name: Data
   ///File Name: Data.java
   ///Date Finshed: 6/06/16
  
   import java.io.File;
   import java.util.Scanner;

   public class Data {

    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("name-and-numbers.txt"));

        name = fileIn.nextLine();
        a = fileIn.nextInt();
        b = fileIn.nextInt();
        c = fileIn.nextInt();

        fileIn.close();

        System.out.println("done.");
        System.out.println("Your name is: " + name);
        sum = a + b + c;
        System.out.println(a + " + " + b + " + " + c + " = " + sum);
    }
   }
   //this scanner might be bad bc it doesnt allow new numbers to be incorprated without deleting the old
        
    

Picture of the output

Assignment 122