Assignemnt #24: A Dumb Calculator
Code
/// Name: Kelsey Lieberman
/// Period 5
/// 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 firstNum, secondNum, thirdNum;
System.out.println("Use calculator to math:\n");
System.out.print("What is your first number? ");
firstNum = keyboard.nextDouble();
System.out.print("What is your second number? ");
secondNum = keyboard.nextDouble();
System.out.print("What is your third number? ");
thirdNum = keyboard.nextDouble();
System.out.println("\n( " + firstNum + " + " + secondNum + " + " + thirdNum + " ) / 2 = " + ((firstNum + secondNum + thirdNum) / 2));
}
}
Picture of the output