Assignemnt #124 Summoning Three numbers
Code
///Name: Joshua Pell
///Period: 6
///Project Name: Summoning Three Numbers
///File Name: summonThree.java
///Date: 5/31/2015
import java.util.Scanner;
import java.io.File;
public class summonThree
{
public static void main( String[] args )throws Exception
{
System.out.print( "Reading numbers from file \"3nums.txt.\" . . . ");
Scanner inFile = new Scanner( new File( "3nums.txt" ) );
int a, b, c;
a = inFile.nextInt();
b = inFile.nextInt();
c = inFile.nextInt();
System.out.println( "done.\n" + a + " + " + b + " + " + c + " = " + (a + b + c));
}
}
Picture of the output