public class New
{
public static void main(String[] args)
{
System.out.println("Calculator");
float a = StdIn.readFloat();
char sign = StdIn.readChar();
float b = StdIn.readFloat();
float c = 0;
if (sign == '+') c = a+b;
else if (sign == '-') c = a-b;
else if (sign == 'x') c = a*b;
else if (sign == '/') c = a/b;
System.out.println(c);
}
}
I need some help with this bit of code, I'm attempting to make a calculator that takes StdIn input with both character and float data types.