Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Imagen N2
Imagen N3
Imagen N4
Imagen N5
private boolean midletPaused = false; double valor1 = 0, valor2 = 0 , result = 0; if (displayable == form) { if (command == Division) { valor1 = Double.parseDouble(n1.getString ()); valor2 = Double.parseDouble(n2.getString ()); if (valor1 == 0) r.setText ("Valor Incorrecto"); else { result = valor1 / valor2; r.setText (String.valueOf(result)); } // write post-action user code here
} else if (command == Multiplicacion) { valor1 = Double.parseDouble(n1.getString ()); valor2 = Double.parseDouble(n2.getString ()); result = valor1 * valor2; r.setText (String.valueOf(result));
} else if (command == Resta) { valor1 = Double.parseDouble(n1.getString ()); valor2 = Double.parseDouble(n2.getString ()); result = valor1 - valor2; r.setText (String.valueOf(result));
} else if (command == Suma) { valor1 = Double.parseDouble(n1.getString ()); valor2 = Double.parseDouble(n2.getString ()); result = valor1 + valor2; r.setText (String.valueOf(result));