Programming Assignment #25
Code
/// Name: Dylan Sleeper
/// Period: 6
/// Program Name: Dumb Calculator
/// File Name: calculator.java
/// Date Finished: 10/22/2015
import java.util.Scanner;
public class calculator {
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
System.out.print("What is your first number? ");
double i1 = keyboard.nextDouble();
System.out.print("What is your second number? ");
double i2 = keyboard.nextDouble();
System.out.print("What is your third number? ");
double i3 = keyboard.nextDouble();
System.out.println("( " + i1 + " + " + i2 + " + " + i3 + " ) / 2 is... " + ((i1 + i2 + i3) / 2));
}
}
Outputs