Java Programming Tutorial – 7 – Building a Basic Calculator

By | 2015년 3월 31일

package hello;
import java.util.Scanner; 

public class apples {
    public static void main(String[] args) {
		Scanner bucky = new Scanner(System.in);
		 double fnum, snum, answer;
		 System.out.println("Enter first num");
		 fnum = bucky.nextDouble();
		 System.out.println("Enter Second num");
		 snum = bucky.nextDouble();
		 answer = fnum + snum;
		 System.out.println(answer);
		
	}
}