import java.util.Scanner;
class Calculator{
public static void main (String [] args) {
Scanner suslady = new Scanner(System.in);
int fnum, snum, remander, answer;
char operation;
System.out.print ("Enter 1st # ");
fnum = suslady.nextInt();
operation = suslady.nextChar();
System.out.print ("Enter 2nd # ");
snum = suslady.nextInt();
if(operation == '+') {
answer = fnum + snum;
System.out.print ("Answer: ");
System.out.println (answer);
}
if(operation == '-') {
answer = fnum - snum;
System.out.print ("Answer: ");
System.out.println (answer);
}
if(operation == *') {
answer = fnum * snum;
System.out.print ("Answer: ");
System.out.println (answer);
}
if(operation == '/') {
remander = fnum % snum;
answer = fnum / snum;
System.out.print ("Answer: ");
System.out.println (answer);
System.out.print ("Remander: ");
System.out.println (remander);
}
}
}
When I run it it says
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token(s), misplaced construct(s)
at Calculator.main(Calculator.java:4)
ps. I use eclipse