diff --git b/Ejercicio01.java a/Ejercicio01.java new file mode 100644 index 0000000..167665e --- /dev/null +++ a/Ejercicio01.java @@ -0,0 +1,33 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author user + */ +public class Ejercicio01 { + public static void main(String[] args) { + + int a = 1; + int b = 1; + + int suma = a+b; + int resta = a-b; + int multiplicacion = a*b; + int division = a/b; + int modulo = a%b; + + System.out.println("Valores de variales: " + a+" y " + b); + + System.out.println("Suma: " + suma); + System.out.println("Resta: " + resta); + System.out.println("Multiplicacion: " + multiplicacion); + System.out.println("División: " + division); + System.out.println("Módulo: " + modulo); + } + + +} diff --git b/Ejercicio02.java a/Ejercicio02.java new file mode 100644 index 0000000..1c19caa --- /dev/null +++ a/Ejercicio02.java @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author user + */ +public class Ejercicio02 { + public static void main(String[] args) { + int a; + int b; + + a=2; + + for (int i = 1; i <= 3 ; i++) { + b=i; + System.out.println("El valor de A es: " + a); + System.out.println("El valor de B es: " + b); + + if(a>b){ + System.out.println("A es mayor a B"); + } + else if(a=0)); + + System.out.println("El número que pasó la prueba es: " + n); + + + + } +} diff --git b/Ejercicio09.java a/Ejercicio09.java new file mode 100644 index 0000000..3f16db2 --- /dev/null +++ a/Ejercicio09.java @@ -0,0 +1,44 @@ + +import java.util.Scanner; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author user + */ +public class Ejercicio09 { + public static void main(String[] args) { + String contraseña = new String("luque"); + Scanner sc = new Scanner(System.in); + + System.out.print("Introduzca una contraseña: "); + String input = sc.nextLine(); + //System.out.println(""); + + for(int i=0; i<2; i++){ + if(!es_correcto(contraseña, input)){ + System.out.print("Vuelve a intentar: "); + input = sc.nextLine(); + } + else{ + System.out.println("Correcto!"); + return; + } + } + + System.out.println("Fallaste jaja!!"); + } + + public static boolean es_correcto(String contraseña, String input){ + if(contraseña.compareTo(input) == 0){ + return true; + } + return false; + } + +} diff --git b/Ejercicio10.java a/Ejercicio10.java new file mode 100644 index 0000000..d28c745 --- /dev/null +++ a/Ejercicio10.java @@ -0,0 +1,41 @@ + +import java.util.Scanner; + +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/** + * + * @author user + */ +public class Ejercicio10 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String[] dias_laborales = new String[5]; + String input = new String(); + + dias_laborales[0] = "lunes"; + dias_laborales[1] = "martes"; + dias_laborales[2] = "miercoles"; + dias_laborales[3] = "jueves"; + dias_laborales[4] = "viernes"; + + System.out.print("Introduzca un dia: "); + input = sc.nextLine(); + System.out.println(""); + + for (int i = 0; i < 5; i++) { + if(input.compareTo(dias_laborales[i]) == 0){ + System.out.println("Es laboral!"); + return; + } + } + + System.out.println("No es laboral!"); + + + } +} diff --git b/README.md a/README.md new file mode 100644 index 0000000..cfd7048 --- /dev/null +++ a/README.md @@ -0,0 +1,6 @@ +# Instrucciones para Compilar y Ejecutar + +* En la terminal de linux, posicionarse en la carpeta donde se encuentran los archivos **.java** +* En la terminal, escribir **javac Ejercicio01.java** para compilar el ejercicio 1 por ejemplo +* En la misma carpeta se generará un archivo con extension **.class**, que es el archivo compilado. +* Para ejecutar el archivo **Ejercicio01.class/** por ejemplo, se debe escribir en la terminal **java Ejercicio01** (nótese que no se escribe la extensión **.class**) \ No newline at end of file