Assignemnt #124 Summing Three Numbers
Code
/// Name: Drew Boxold
/// Period 5
/// Program Name: SummingThreeNumbers
/// File Name: SummingThreeNumbers.java
/// Date Finished: 6/1/2016
import java.util.Scanner;
import java.io.File;
public class SummingThreeNumbers
{
public static void main(String[] args) throws Exception
{
Scanner fileIn = new Scanner(new File("3nums.txt"));
int num1 = fileIn.nextInt();
int num2 = fileIn.nextInt();
int num3 = fileIn.nextInt();
int sum = num1 + num2 + num3;
System.out.println("\nReading numbers from file...");
Thread.sleep(400);
System.out.println(num1 + " + " + num2 + " + " + num3 + " = " + sum + "\n");
}
}
Picture of the output