TALLER 2 package taller2ejercicio1;
/** * * @author LABORATORIO 7 */ public class Taller2Ejercicio1 {
/** * @param args the command line arguments */ public static void main(String[] args) { System.out.println(" * * * *"); // TODO code application logic here }
} package taller2ejercicio2;
/** * * @author LABORATORIO 7 */ public class Taller2Ejercicio2 {
/**
* @param args the command line arguments */ public static void main(String[] args) { System.out.println ( " * " ); System.out.println (" * * * "); System.out.println(" * * * *"); System.out.println ("* * * * *"); // TODO code application logic here } package taller2ejercicio3;
import java.util.Scanner;
/** * * @author LABORATORIO 7 */ public class Taller2Ejercicio3 {
/** * @param args the command line arguments */
public static void main(String[] args) { String nombre; String apellido;
Scanner teclado = new Scanner(System.in); System.out.println (" Ingrese su nombre " ); nombre = teclado.nextLine();
System.out.println ( "Ingrese su apellido"); apellido = teclado.nextLine();
// TODO code application logic here }
} package taller2ejercicio4;
/** * * @author LABORATORIO 7 */ public class Taller2Ejercicio4 {
/** * @param args the command line arguments */ public static void main(String[] args) {
System.out.println("1"); System.out.println("2"); System.out.println("3"); System.out.println("4"); System.out.println("5"); System.out.println("6"); System.out.println("7"); System.out.println("8"); System.out.println("9"); System.out.println("10");
// TODO code application logic here }
} public class Taller2Ejercicio5 {
/** * @param args the command line arguments */ public static void main(String[] args) { String nombre; String apellido; int edad; int cedula; int calificacion;
Scanner teclado = new Scanner(System.in); System.out.println (" Ingrese su nombre " ); nombre = teclado.nextLine();
System.out.println ( "Ingrese su apellido"); apellido = teclado.nextLine();
System.out.println("Ingrese su edad"); edad = teclado.nextInt();
System.out.println( "Ingrese su cedula"); cedula = teclado. nextInt();
System.out.println("Ingrese su calificacion"); calificacion = teclado.nextInt();
// TODO code application logic here }
} package taller2ejercicio6;
/** *
* @author LABORATORIO 7 */ public class Taller2Ejercicio6 {
/** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("2"); System.out.println("4"); System.out.println("6"); System.out.println("8"); System.out.println("10"); System.out.println("12"); System.out.println("14"); System.out.println("16"); System.out.println("18"); System.out.println("20"); // TODO code application logic here }
} package taller2ejercicio7;
/** * * @author USER1
*/ import java.util.Scanner; public class Taller2Ejercicio7 {
/** * @param args the command line arguments */ public static void main(String[] args) {
double area, base, altura;
System.out.println( "Ingrese la altura"); Scanner captura= new Scanner(System.in); altura = captura.nextDouble();
System.out.println("Ingrese la base"); Scanner captura1= new Scanner(System.in); base = captura1.nextDouble();
area=(base*altura)/2;
System.out.println(" El area del triangulo es " + area);
// TODO code application logic here }
} package taller2ejercicio8;
/** * * @author USER1 */ import java.util.Scanner; public class Taller2Ejercicio8 {
/** * @param args the command line arguments */ public static void main(String[] args) { Scanner entrada= new Scanner(System.in); double Numero1=0; double Numero2=0; double suma=0; double resta=0; double division=0; double multiplicacion=0;
System.out.println("Ingrese el primer numero"); Numero1=entrada.nextDouble(); System.out.println("Ingrese el segundo numero"); Numero2=entrada.nextDouble();
suma=Numero1+Numero2; resta=Numero1-Numero2; division=Numero1/Numero2; multiplicacion=Numero1*Numero2;
System.out.println("La Suma es " +suma); System.out.println("La resta es " +resta); System.out.println("La division es " +division); System.out.println("La multiplicacion es " +multiplicacion);
// TODO code application logic here }
} package taller2ejercicio9;
/** * * @author USER1
*/ import java.util.Scanner; public class Taller2Ejercicio9 {
/** * @param args the command line arguments */ public static void main(String[] args) { Scanner leer = new Scanner(System.in);
int CM; int op; double RES;
System.out.println( "Ingrese la operacion" ); System.out.println( "1.- Centimetos a pulgadas" ); op = leer.nextInt();
switch (op){ case 1: System.out.println( "Centimetros a pulgadas" ); System.out.println( "Ingrese los centimetros" ); CM = leer.nextInt(); RES = (CM*2.54); System.out.println( "El resultado es: " +RES); // TODO code application logic here }
} } package taller2ejercicio10;
/** * * @author USER1 */ import java.util.Scanner; public class Taller2Ejercicio10 {
/** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("Ingrese la cantidad en dolares"); Scanner leer=new Scanner (System.in); int euro=leer.nextInt(); double a,b; a= 1.11; b= euro*a; System.out.println("El valor en euros es " +b);
// TODO code application logic here
}
}