aplicacion Ecuacion segundo grado

import java.lang.*; import java.util.*; // LA CLASE APLICACION ES AQUELLA QUE TIENE EL METODO "MAIN" public class ApliEcuacion { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //variables int aa, bb, c1; double x1 = 0, x2 = 0, d = 0; //pedir los datos System.out.println("Teclea el valor de a" + "\t"); aa = sc.nextInt(); System.out.println("Teclea el valor de b" + "\t"); bb = sc.nextInt(); System.out.println("Teclea el valor de c \t"); c1 = sc.nextInt(); // GENERADOR DE OBJETOS HEREDEROS DE LA CLASE SOPORTE EcuacionC e1 = new EcuacionC(); EcuacionC e2 = new EcuacionC(); e1.set_a(aa); e1.set_b(bb); e1.set_c(c1); //calcular discriminante d = e1.calc_dis(); // decision if (d > 0) { x1 = e1.calc_x1(); x2 = e1.calc_x2(); System.out.println("x1 = " + x1 + " x2 = " + x2); } // true d >0 else { if ( d == 0) { x1 = e1.calc_xiguales(); x2 = x1; System.out.println("x1 es igual a X2 " + x1); } //true d = 0 else { e1.avisa_imaginarias(); } //false d = 0 } // false d > 0 //calcular discriminante } // del main } // de la clase

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.