ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Sectoria


Enviado por   •  8 de Abril de 2016  •  Documentos de Investigación  •  340 Palabras (2 Páginas)  •  68 Visitas

Página 1 de 2

CASO 01:

package javaapplication7;

import javax.swing.JOptionPane;

/**

 *

 * @author Alumno

 */

public class JavaApplication7 {

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        //. TODO code application logic here

String strvarA;

String strvarB;

String strvarC;

String strvarD;

int intvarA;

int intvarB;

int intvarC;

double D;

double AA;

double DD;

double x1;

double x2;

double RE;

double IM;

strvarA = JOptionPane.showInputDialog("ingrese varA");

strvarB = JOptionPane.showInputDialog("ingrese varB");

strvarC = JOptionPane.showInputDialog("ingrese varC");

intvarA = Integer.parseInt(strvarA);

intvarB = Integer.parseInt (strvarB);

intvarC = Integer.parseInt (strvarC);

D = intvarB^2-4*intvarA*intvarC;

DD = Math.sqrt(D);

AA = (2*intvarA);

if (D >= 0){

    x1 = (-intvarB+DD)/AA;

    x2 = (-intvarB-DD)/AA;

   

System.out.println("La ecuacion tiene raices reales:" + x1 + x2);

}

 else {

    RE = -intvarB/AA;

    IM = DD/intvarA*2;

System.out.println("La ecuacion tiene raices complejas conjuugadas :");

System.out.println("Parte real :" + RE);

System.out.println("Parte imaginaria :" + IM); }

    }

}

   

CASO 02:

package javaapplication1;

import javax.swing.JOptionPane;

/**

 *

 * @author alumno

 */

public class JavaApplication1 {

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        // TODO code application logic here

    String strnota1;

    String strnota2;

    String strnota3;

    int intnota1;

    int intnota2;

    int intnota3;

    int promedio;

    strnota1 = JOptionPane.showInputDialog("Ingrese nota 1");

...

Descargar como (para miembros actualizados)  txt (2.2 Kb)   pdf (41.9 Kb)   docx (8.3 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com