Assignemnt #124 and Summing Three Numbers from a File
Code
/// Name: Brian Phillips
/// Period 5
/// Program Name: Summing Three Numbers from a File
/// File Name: three.java
/// Date Finished: 5/31/2016
import java.io.File;
import java.util.Scanner;
class three
{
public static void main (String [] args) throws Exception
{
int a,b,c;
Scanner fileIn = new Scanner(new File("3nums.txt"));
a = fileIn.nextInt();
b = fileIn.nextInt();
c = fileIn.nextInt();
fileIn.close();
System.out.println(a + " + " + b + " + " + c + " = " + (a+b+c));
}
}
Picture of the output