``````import java.io.*;
public class Calculator{

public static void main(String[] args){
int x=1, y=1;
String Str_1,Str_2;
System.out.println("Enter an Equation: ");
try
{
System.out.print("Enter another Equation: ");
x=Integer.parseInt(Str_1);
y=Integer.parseInt(Str_2);
x = x+y;
x = x-y;
x = x*y;
x = x/y;
}
catch(ArithmeticException e)
{
System.out.println("Divide by zero ERROR.");
}
catch(NumberFormatException e)
{
System.out.println("Invalid number entered.");
}
catch(Exception e)
{
System.out.println("Invalid number entered.");
}
finally
{
int minus=x-y;
int multiply=x*y;
int divide=x/y;

switch (x)
{
case'+':
break;

case'-':
break;

case'*':
break;

case'/':
break;
}
}
}
}``````

when i enter an equation it doesn't give me answers... i need to know what's the problem and how it will work. thanks.

One, do some formatting and indentation. It's impossible to read as it is.

``````int x=1, y=1;
String Str_1,Str_2;
System.out.println("Enter an Equation: ");
try
{
System.out.print("Enter another Equation: ");
x=Integer.parseInt(Str_1);
y=Integer.parseInt(Str_2);
x = x+y;
x = x-y;
x = x*y;
x = x/y;
}``````

Lines 3 and 7 - I have no idea what I'm supposed to enter here, so I'll enter:

``5x + 7y = 87``

and

``10*k - (87 * t^4) = 65``

Is that what you want? You asked for two equations and I gave you two equations. If that isn't what you want me to type in, you need to tell me what I need to type in. "Type in an equation" is too vague.

Lines 9 and 10 - You asked for two equations, but you are parsing them into two integers. Do you want two equations or do you want two integers?

Lines 11 - 14 - Why do you keep overwriting x here?

``````switch (x)
{
case'+':
break;

case'-':
break;

case'*':
break;

case'/':