Created
February 18, 2020 20:10
-
-
Save rokon12/4cafec88e9193b6d3744325f2fc3753d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scr = new Scanner(System.in); | |
Calculator calculator = new Calculator(); | |
System.out.println("Enter first input: "); | |
int a = scr.nextInt(); | |
System.out.println("Enter second input: "); | |
int b = scr.nextInt(); | |
System.out.println(" Choose your options: \n" + | |
"1 for addition\n" + | |
"2 for subtraction\n" + | |
"3 for multiplication\n" + | |
"4 for division\n" + | |
""); | |
int option = scr.nextInt(); | |
if (option == 1) { | |
int result = calculator.add(a, b); | |
System.out.println("Result: " + result); | |
} | |
if (option == 2) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import java.util.Scanner;
public class Main {
}