Advertisement
MelindaElezovic

FindAvg

Nov 1st, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. //Melinda
  2. //10.29.15
  3. //Find Average
  4. import java.util.Scanner;
  5.  
  6. public class FindAvg
  7. {
  8.   public static void main(String[] args)
  9.   {
  10.     Scanner input = new Scanner (System.in);
  11.     System.out.println("Please enter a number");
  12.     double num1 = input.nextDouble();
  13.     System.out.println("Please enter another number");
  14.     double num2 = input.nextDouble();
  15.     System.out.println("The average of your two numbers is " + (num1+num2)/2);
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement