Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main
- {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.err.println("Type the numbers x");
- double num1 = Double.parseDouble(scanner.nextLine());
- System.err.println("Type the numbers y");
- double num2 = Double.parseDouble(scanner.nextLine());
- System.err.println("type the function you want to execute (sum,multi,divade,subract)");
- String fucn = scanner.nextLine();
- scanner.close();
- Calculator cal = new Calculator();
- double result = cal.calculate(num1, num2, fucn);
- System.err.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement