Name: Anonymous 2009-09-30 1:00
I'm a first time /prog/er here and I know these kinds of threads are looked down upon, but Ive got an assignment due tomorrow and I just started on it a few hours ago. I have to write a Java program that takes in two numbers and a math sign like plus, minus, times and divide and gives the answer. Ive been trying to use parameters but I'm not sure if Im doing it right. Its not compiling yet but this is what I have so far. Any help would be appreciated.
import StringTokenizer
import JOptionPane
public void class calculate
{
public static void main(string args[])
{
int[] para = input;
if(para[3] = +)
para[1+2] = output;
if(para[3] = -)
para[1-2] = output;
if(para[3] = *)
para[1*2] = output;
if(para[3] = /)
para[1/2] = output;
}
}