This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class trabajoClase { | |
| public static void main(String[] args) { | |
| String num = "1234"; | |
| String cadenaInv; | |
| for (int i = num.length(); i >= 0; i--) { | |
| cadenaInv = "invertidos: " + num.charAt(i); | |
| System.out.println(cadenaInv); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Ensayo { | |
| public static void main(String[] args) { | |
| String inv = ""; | |
| System.out.println(convertir("1234", inv)); | |
| } | |
| public static String convertir(String num,String inv) { | |
| for (int i = num.length() - 1; i >= 0; i--) { | |
| inv += num.charAt(i); | |
| }return inv; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.swing.JOptionPane; | |
| public class Ejercicio1 { | |
| public static void main(String[] args) { | |
| int contador = 0; | |
| int contador2 = 0; | |
| int importe = 0; | |
| int users = Integer.parseInt(JOptionPane.showInputDialog("Numero de Usuarios")); | |
| for (int i = 0; i < users; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.swing.JOptionPane; | |
| public class Ejercicio1 { | |
| private static int metodo(int a) { | |
| int b = 0; | |
| for (int i = 1; i <= a; i++) { | |
| int mod = i*3; | |
| b += mod; | |
| }return b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TrabajoClase { | |
| public static void main(String[] args) { | |
| System.out.println(convertir("123")); | |
| } | |
| public static String convertir(String s) { | |
| String num = ""; | |
| for (int i = s.length() - 1; i >= 0; i--) { | |
| num += s.charAt(i); | |
| }return num; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.swing.JOptionPane; | |
| public class Calc2 { | |
| public static void main(String[] args) { | |
| int f = Integer.parseInt(JOptionPane.showInputDialog("A")); | |
| int g = Integer.parseInt(JOptionPane.showInputDialog("A")); | |
| int a; | |
| int b; | |
| String contador = ""; | |
| if (f<g) { | |
| a = f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Calc { | |
| public static void main(String[] args) { | |
| int[] fila = new int[100]; | |
| fila[0]=3; | |
| fila[1]=3; | |
| int suma = fila[0]+fila[1]; | |
| System.out.println("a: "+suma); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Calc { | |
| public static void main(String[] args) { | |
| // declaramos y construimos un arreglo con una capacidad de diez números | |
| // enteros | |
| int[] arreglo = new int[10]; | |
| // asignamos los valores para cada posición en el arreglo... | |
| arreglo[0] = 100; | |
| arreglo[1] = 200; | |
| arreglo[2] = 300; | |
| arreglo[3] = 400; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Calc { | |
| public static void main(String[] args) { | |
| // declaramos y construimos un arreglo con una capacidad de diez números | |
| // enteros | |
| int[] arreglo = new int[10]; | |
| // asignamos los valores para cada posición en el arreglo... | |
| arreglo[0] = 100; | |
| arreglo[1] = 200; | |
| arreglo[2] = 300; | |
| arreglo[3] = 400; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Trabajo; | |
| import javax.swing.JOptionPane; | |
| //Main | |
| public class Proyecto { | |
| public static void main(String[] args) { | |
| int operacion = Integer.parseInt(JOptionPane.showInputDialog("Ingrese una opcion \n" | |
| + "1-Suma \n" | |
| + "2-Resta \n" | |
| + "3-Multiplicacion")); |