public static String formulaCalcularRenda = "(Loja.getRendaFixa()*(1+super.getArea()/100)+super.getReceita()/100)";
@Override
public double calcularRenda(){
return (Loja.getRendaFixa()*(1+super.getArea()/100)+super.getReceita()/100);
}
My main objective is to reuse the code, while being the formula altered by order of the user itself. I've tried something similar before, but I was uncapable to succeed, because the string has letters.
@Override
public double calcularRenda(){
return Double.parseDouble(Loja.formulaCalcularRenda);
}
Can someone help me?