thenewboston

Java Programming Tutorial - 7 - Building a Basic Calculator

Aug 22nd, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class apples{
  4.    public static void main(String args[]){
  5.       Scanner bucky = new Scanner(System.in);
  6.       double fnum, snum, answer;
  7.       System.out.println("Enter first num: ");
  8.       fnum = bucky.nextDouble();
  9.       System.out.println("Enter second num: ");
  10.       snum = bucky.nextDouble();
  11.       answer = fnum + snum;
  12.       System.out.println(answer);
  13.    }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment