I'm just writing a basic code that takes 2 inputs and an operator and solves. I have to code the program to tell it to not let a division of 0 happen but I my else keeps having an error message saying that there is a syntax error token. I'm not sure why because I have done if else statements in the past and it doesn't look any different. I am new at programming. Help would be appreciated
if((operator == '/') && (operand2 == 0))
JOptionPane.showMessageDialog(null,"Division by 0 not allowed");
System.exit(0);
else
add = operand1 + operand2;
mult = operand1 * operand2;
sub = operand1 - operand2;
div = operand1 / operand2;
remainder = operand1 % operand2;
homeworktag.