Assignment #25
Code
///Name:Mahima Choudhary
///Period: 6
///Project Name: ADumbCalculator
///File Name: ADumbCalculator
///Date Finished: 10/5/15
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