Código Java:
Ver original
package calcu; import java.util.Scanner; /** * * @author Diego */ public class Calcu extends Operar { Operar sc = new Operar(); for(int r=0;r<1000;r++){ System.out.println("---------------------------------------------------------------------------------------------------------------------"); System.out.println("Si quiere calcular Seno escriba 'sen', Coseno escriba 'cos', Tangente escriba 'tan', Logaritmo escriba 'log', Raiz cuadrada escriba 'raiz'"); System.out.println("---------------------------------------------------------------------------------------------------------------------"); float suma = 0; for(int i=0;i<cadena.length();i++){ if(cadena.charAt(i)=='-'){ i++; }else{ if(cadena.charAt(i)=='+'){ i++; }else{ if(cadena.charAt(i)=='*'){ i++; }else{ if(cadena.charAt(i)=='/'){ i++; }else{ if(cadena.equals("sen")){ i++; sc.SENO(); }else{ if(cadena.equals("cos")){ i++; sc.COSENO(); }else{ if(cadena.equals("tan")){ i++; sc.TANGENTE(); }else{ if(cadena.equals("log")){ i++; sc.LOGARITMO(); }else{ if(cadena.equals("raiz")){ i++; sc.RAIZCUADRADA(); }else{ if(cadena.equals("0")){ }else } } } } } } } } } } } } }