LOS VIDEOS ESTAN EN http://www.youtube.com/user/rvnrodrigo
import javax.swing.*;
import java.util.*;
public class PEDIR
{
public static void main(String args[])
{
double a,b,c,r;
a=pj();
b=pj();
c=pj();
r=raiz(a,b,c);
imp("LA RAIZ ES: "+r);
imj("LA RAIZ ES: "+r);
}
public static void imp(String x)
{
System.out.print(x);
}
public static void imj(String x)
{
JOptionPane.showMessageDialog(null, x);
}
public static double p()
{
double x;
Scanner m=new Scanner(System.in);
imp("DAME UN NUMERO: ");
x=m.nextDouble();
return x;
}
public static double pj()
{
double x;
x=Double.parseDouble(JOptionPane.showInputDialog("DAME UN VALOR: "));
return x;
}
public static double raiz(double a,double b,double c )
{
return Math.sqrt(a+b+c);
}
}//clase
Suscribirse a:
Enviar comentarios (Atom)
0 comentarios:
Publicar un comentario