Keyboard Input #25 (One word... "Algebra" and PEMDAS)
Code
/// Name: Amir Salehi
/// Period: 7
/// Program name: ADumbCalculator
/// File name: ADumbCalculator.java
/// Date: Finished 10/2/2015
import java.util.Scanner;
public class ADumbCalculator
{
public static void main( String[] args )
{
double firstNumber, secondNumber, thirdNumber ;
Scanner keyboard = new Scanner(System.in);
System.out.print( "What is your first number? " );
firstNumber = keyboard.nextDouble();
System.out.print( "What is your second number? ");
secondNumber = keyboard.nextDouble();
System.out.print( "What is your second number? ");
thirdNumber = keyboard.nextDouble();
System.out.println( "( " + firstNumber + " + " + secondNumber + " + " + thirdNumber + ")" + " " + "/" + " " + "2 is..." + ((firstNumber + secondNumber + thirdNumber) / 2 ));
}
}
Picture of the output