Question: import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print( Please use brackets '(' or ')'

import java.util.*;

public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print( " Please use brackets '(' or ')' in case of BODMAS calculations. The calculator might give wrong answers otherwise. Enter the expression: "); String expression = scanner.nextLine();

Calculator calculator = new Calculator();

try { int result = calculator.evaluateExpression(expression); System.out.println("Result: " + result); } catch (Exception e) { System.out.println("Error: " + e.getMessage()); } } }

Add a loop to this code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!