MrDoyle

Dumb Calculator

Sep 18th, 2020
739
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner (System.in);
  7.  
  8.         System.out.print("What is your first number? ");
  9.         Double num1 = input.nextDouble();
  10.  
  11.         System.out.print("What is your second number? ");
  12.         Double num2 = input.nextDouble();
  13.  
  14.         System.out.print("What is your third number? ");
  15.         Double num3 = input.nextDouble();
  16.  
  17.         double num4 = (num1 + num2 + num3) / 2;
  18.         System.out.println("( " + num1 + " + " + num2 + " + " + num3 + " ) / 2 is ..." + num4);
  19.     }
  20. }
RAW Paste Data