Assignment #25
Code
/// Name: Kabir Virk
/// Period: 6
/// 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 )
{
Scanner keyboard = new Scanner(System.in);
Double n1, n2, n3, n4;
System.out.print( "What is your first number? " );
n1 = keyboard.nextDouble();
System.out.print( "What is your second number? " );
n2 = keyboard.nextDouble();
System.out.print( "What is your third number? " );
n3 = keyboard.nextDouble();
n4 = (n1+n2+n3) / 2;
System.out.println( "\n( " + n1 + " + " + n2 + " + " + n3 + " ) / 2 is. " + n4 );
}
}
Picture of the output