package calcular;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class calculojava extends HttpServlet {
   public int calc(int op1, int op2, int operacao) throws ServletException, IOException{
        if(operacao == 1)
            return (op1+op2);
        if(operacao == 2)
            return (op1-op2);
        if(operacao == 3)
            return (op1*op2);
        if(operacao == 4)
            return (op1/op2);
        return 0;
   }
}
