Assignemnt #25: A dumb calculator
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: A dumb calculator
/// File Name: ADumbCalculator.java
/// Date Finished: 9/29/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.println( "What is your first number? ");
firstNumber = keyboard.nextDouble();
System.out.println();
System.out.println( "What is your second number? ");
secondNumber = keyboard.nextDouble();
System.out.println();
System.out.println( "What is your third number? " );
thirdNumber = keyboard.nextDouble();
System.out.println();
System.out.println( " ( " + firstNumber + "+ " + secondNumber + "+ " + thirdNumber + ") / 2 is ... " );
System.out.println( (firstNumber + secondNumber + thirdNumber ) / 2 );
}
}
Picture of the output