Professional Documents
Culture Documents
Laboratorio 1
Laboratorio 1
EJERCICIO 01
import java.io.*; public class lab01ej01 { public static void main (String args[]) throws IOException { BufferedReader in; in = new BufferedReader (new InputStreamReader (System.in)); int n; double n1,n2; System.out.println ("PROGRAMA DE CONVERSION DE MONEDA Boliviana A Dolar"); System.out.print ("Moneda en [Bs] : "); n = Integer.parseInt (in.readLine ()); n1=n/7.0; System.out.println ("Conversion [$us]= " + (int)n1); n2=(int)((n1-(int)n1)*7); System.out.println ("Cambio [Bs]= " + n2); } }
EJERCICIO 02
import java.io.*; public class lab01ej02 { public static void main (String args []) throws IOException { BufferedReader in; in = new BufferedReader (new InputStreamReader (System.in)); double a; System.out.println ("Cuadrado de un Numero"); System.out.print ("Ingrese Numero : "); a=(Float.valueOf (in.readLine ())).floatValue (); a=Math.pow(a,2.); System.out.println ("Resultado : " + a); } }
EJERCICIO 03
import java.io.*; public class lab01ej03 { public static void main (String args []) throws IOException { BufferedReader in; in = new BufferedReader (new InputStreamReader (System.in)); double a; System.out.println ("Raiz de un Numero"); System.out.print ("Ingrese Numero = "); a=(Float.valueOf (in.readLine ())).floatValue (); a=Math.pow(a,1/2.); System.out.println ("Resultado : " + a); } }
EJERCICIO 04
import java.io.*; public class lab01ej04 { public static void main (String args []) throws IOException { BufferedReader in; in = new BufferedReader (new InputStreamReader (System.in)); double a; System.out.print ("Ingrese Numero = "); a=(Float.valueOf (in.readLine ())).floatValue (); a=Math.pow(a,3.)+Math.pow(a,1./5.); System.out.println ("Resultado : " + a); } }