SHARE
TWEET

JAVA CALCULATOR

Vankata17 Oct 22nd, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6. public class Main {
  7.  
  8.     public static void main(String[] args) {
  9.         Scanner scan =new Scanner(System.in);
  10.         double firstNum = scan.nextDouble();
  11.         double secondNum = scan.nextDouble();
  12.         double result1 = (firstNum + secondNum);
  13.         double result2 = (firstNum - secondNum);
  14.         double result3 = (firstNum * secondNum);
  15.         double result4 = (firstNum / secondNum);
  16.  
  17.         System.out.println("SUM"+result1);
  18.         System.out.println("SUBTRACTION"+result2);
  19.         System.out.println("MULTIPLY"+result3);
  20.         System.out.println("DIVISION"+result4);
  21.  
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top