CODE:
class CalculatorOperations
{
public static void main (Strings [ ] args)
{
System.out.println (“Calculation Section with operations:”);
System.out.println (“Enter the two integers”);
int value1;
int value2;
void get data (int a; int b)
{
value1 = a;
value2 = b;
}
System.out.println (“Enter operation ( + - * / ) : ”);
char operator;
void get data (char o)
{
char operator = o;
}
int calculate result ( );
{
int result;
if (operator = “ + ”)
{
result = value1 + value2;
}
else if (operator = “ - ”)
{
result = value1 - value2;
}
else if (operator = “ * ”)
{
result = value1 * value2;
}
else if (operator = “ / ” && value2 != 0)
{
result = value1 / value2;
}
else
{
System.out.println (“unknown operator” + operator + “Please try again.”);
}
System.out.println (“ The result is: ” +result);
}
}
}
