update(order)

This commit is contained in:
tuz 2025-10-16 23:37:17 -05:00
parent c9037ed317
commit 57065adb51
50 changed files with 683 additions and 1 deletions

0
.gitignore vendored Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

184
api/calificar/src/Main.java Normal file
View File

@ -0,0 +1,184 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
Calificar calificar;
try {
System.out.printf("%nIngrese el numero de estudiantes: ");
String numeroDeEstudiantes_userInput = bufferedReader.readLine();
int numeroDeEstudiantes_userInputToInt = Integer.parseInt(numeroDeEstudiantes_userInput);
calificar = new Calificar(numeroDeEstudiantes_userInputToInt);
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
return;
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
return;
}
calificar.iniciar();
}
}
class Calificar {
int[] estudiantes;
Calificar(int estudiantes) {
this.estudiantes = new int[estudiantes];
}
public void iniciar() {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
try {
String calificacion_userInput;
int calificacion_userInputToInt;
for (int i = 0; i <= estudiantes.length - 1; i += 1) {
System.out.printf("%nIngrese la calificaciones No %d: ", i);
calificacion_userInput = bufferedReader.readLine();
calificacion_userInputToInt = Integer.parseInt(calificacion_userInput);
estudiantes[i] = calificacion_userInputToInt;
}
for (int i = 0; i <= estudiantes.length - 1; i += 1) {
System.out.printf("%nLa calificasion No.%d es: %d%n", i, estudiantes[i]);
switch (estudiantes[i]) {
case 100:
case 99:
case 98:
case 97:
case 96:
case 95:
case 94:
case 93:
case 92:
case 91:
case 90:
System.out.println("Excelente");
break;
case 89:
case 88:
case 87:
case 86:
case 85:
case 84:
case 83:
case 82:
case 81:
case 80:
case 79:
case 78:
case 77:
case 76:
case 75:
case 74:
case 73:
case 72:
case 71:
case 70:
System.out.println("Bueno");
break;
case 69:
case 68:
case 67:
case 66:
case 65:
case 64:
case 63:
case 62:
case 61:
case 60:
case 59:
case 58:
case 57:
case 56:
case 55:
case 54:
case 53:
case 52:
case 51:
case 50:
System.out.println("Regular");
break;
case 49:
case 48:
case 47:
case 46:
case 45:
case 44:
case 43:
case 42:
case 41:
case 40:
case 39:
case 38:
case 37:
case 36:
case 35:
case 34:
case 33:
case 32:
case 31:
case 30:
case 29:
case 28:
case 27:
case 26:
case 25:
case 24:
case 23:
case 22:
case 21:
case 20:
case 19:
case 18:
case 17:
case 16:
case 15:
case 14:
case 13:
case 12:
case 11:
case 10:
case 9:
case 8:
case 7:
case 6:
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:
System.out.println("Insuficiente");
break;
default:
if (estudiantes[i]<0 || 100<estudiantes[i]) {
System.out.printf("La calificacion ingresada no es valida%n%n");
break;
}
break;
}
}
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
return;
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
return;
}
}
}

View File

@ -0,0 +1,19 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
try {
System.out.printf("Input a number");
int inputToInt = Integer.parseInt(BufferedReader.readLine());
} catch (IOException e) {
} catch (NumberFormatException e) {
}
}
}

View File

@ -0,0 +1,116 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main
{
public static void main(String[] args) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader buff = new BufferedReader(isr);
String inputUser;
try {
// Buffer
System.out.printf("%n");
System.out.printf("Ingrese un numero Int: ");
inputUser = buff.readLine();
int inputUserInt = Integer.parseInt(inputUser);
System.out.printf("Ingrese un numero Float: ");
inputUser = buff.readLine();
float inputUserFloat = Float.parseFloat(inputUser);
System.out.printf("Ingrese un numero Double: ");
inputUser = buff.readLine();
double inputUserDouble = Double.parseDouble(inputUser);
System.out.printf("Ingrese un numero String: ");
inputUser = buff.readLine();
String inputUserString = inputUser;
System.out.printf("| Int: %d | Float: %.02f | Double: %.02f | String: %s |%n",
inputUserInt, inputUserFloat, inputUserDouble, inputUserString);
System.out.printf("%n");
// Loop
for (int x = 1; x <= 11; x = x + 1) {
// Loop 11
System.out.printf("Loop: %d%n", x);
}
// Other parsers
System.out.printf("%n");
switch ((int)12.23D) {
case 11:
System.out.printf("Case: 11%n");
break;
case 12:
System.out.printf("Case: 12%n");
break;
case 13:
System.out.printf("Case: 13%n");
break;
default:
System.out.printf("Case: Default%n");
break;
}
System.out.printf("%n");
// Print parser
System.out.printf("Integer 0: %d%n", (int) 1.2);
System.out.printf("Float 0: %.2f%n", 1f);
System.out.printf("Float 1: %.2f%n", (float)1);
System.out.printf("Double 0: %.2f%n", 1d);
System.out.printf("Double 1: %.2f%n", (double)1);
System.out.printf("Long 0: %d%n", 1l);
System.out.printf("Long 1: %d%n", (long) 1);
System.out.printf("String 0: %s%n", String.valueOf(1));
System.out.printf("String 1: %s%n", String.valueOf(2f));
System.out.printf("String 2: %s%n", String.valueOf(3l));
System.out.printf("String 3: %s%n", String.valueOf((int) 4.23));
System.out.printf("String 4: %s%n", String.valueOf((long) 5.23));
System.out.printf("String 5: %s%n", String.valueOf((float) 6.25));
System.out.printf("String 6: %s%n", String.valueOf((double) 7.71));
System.out.printf("String 7: %s%n", String.format("%.2f", 8.18));
// Impotant letters
System.out.printf("%n");
System.out.printf("return;%n");
System.out.printf("java.io.BufferedReader;%n");
System.out.printf("java.io.InputStreamReader;%n");
System.out.printf("java.io.IOException;%n");
System.out.printf("%n");
System.out.printf("InputStreamReader isr = new InputStreamReader(System.in);%n");
System.out.printf("BufferedReader buff = new BufferedReader(isr);%n");
System.out.printf("%n");
System.out.printf("buff.readLine();%n");
System.out.printf("Float.parseFloat();%n");
System.out.printf("Integer.parseInt();%n");
System.out.printf("Double.parseDouble();%n");
System.out.printf("Long.parseLong();%n");
System.out.printf("%n");
System.out.printf("try{}%n");
System.out.printf("catch{IOException e}%n");
System.out.printf("catch{NumberFormatException e}%n");
System.out.printf("%n");
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
}
}
}

View File

@ -0,0 +1,44 @@
import java.util.Scanner;
class Main {
public static void main(String [] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Input int");
int num = scan.nextInt();
System.out.println("Input Bool");
boolean bol = scan.nextBoolean();
System.out.println("Input Double");
double doble = scan.nextDouble();
System.out.println("Input Float");
float flot = scan.nextInt();
System.out.println("Input Long");
long log = scan.nextInt();
System.out.println("Input Short");
short shor = scan.nextShort();
System.out.println("Input Byte");
byte byt = scan.nextByte();
System.out.println("Input String");
String str = scan.nextLine();
System.out.println();
System.out.println();
System.out.println(num);
System.out.println(bol);
System.out.println(doble);
System.out.println(flot);
System.out.println(log);
System.out.println(shor);
System.out.println(byt);
System.out.println(str);
}
}

View File

@ -0,0 +1,61 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
class Main {
public static void main(String[] args) {
InputStreamReader input_stream_reader = new InputStreamReader(System.in);
BufferedReader buffered_reader = new BufferedReader(input_stream_reader);
String input_user;
int input_user_to_int;
try {
System.out.println("Ingresa el numero factorial: ");
input_user = buffered_reader.readLine();
input_user_to_int = Integer.parseInt(input_user);
ArrayList<Long> factorial_result = Factorial.calc(input_user_to_int);
if (factorial_result.isEmpty()) { return; }
Long index = 1l;
for (int i = 1; i < input_user_to_int; i++) {
index *= i;
System.out.printf(
"[%d!] %d x %d = %d\t| [%d!] %d x %d = %d \n",
input_user_to_int, i, i+1, factorial_result.get(i - 1),
input_user_to_int, index, i+1, factorial_result.get(i - 1)
);
}
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
}
}
}
class Factorial {
public static ArrayList<Long> calc(int n) {
ArrayList<Long> factorials_list = new ArrayList<>();
if ( n < 0 ) {
System.out.printf("[Error] Tu numero es negativo: %d \n", n);
return factorials_list;
}
Long result = 1L;
for (int i = 2; i <= n; i++) {
result *= i;
factorials_list.add(result);
}
return factorials_list;
}
}

View File

@ -0,0 +1,51 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main {
public static void main(String[] args) {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader BufferedReader = new BufferedReader(inputStreamReader);
try {
System.out.printf("Ingresa el numero factorial: ");
String inputUser = BufferedReader.readLine();
int inputUserToInt = Integer.parseInt(inputUser);
Factorial factorial = new Factorial(inputUserToInt);
if (factorial.calc() == -1) {
return;
}
System.out.printf("[%d!]: %d%n", inputUserToInt, factorial.calc());
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
}
}
}
class Factorial {
int index;
Factorial(int num) {
this.index = num;
}
public long calc() {
if ( index < 0 ) {
System.out.printf("Error Tu numero es negativo: %d%n", index);
return -1;
}
Long result = 1L;
for (int i = 2; i <= index; i++) {
result *= i;
}
return result;
}
}

46
api/fibonacci/Main.java Normal file
View File

@ -0,0 +1,46 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main {
public static void main(String[] args) {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader BufferedReader = new BufferedReader(inputStreamReader);
try {
System.out.printf("Ingresa el numero maximo fibonacci: ");
String inputUser = BufferedReader.readLine();
int inputUserToInt = Integer.parseInt(inputUser);
Fibonacci fibonacci = new Fibonacci(inputUserToInt);
fibonacci.calc();
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
}
}
}
class Fibonacci {
int end, a = 0, b = 1, c;
Fibonacci(int num) {
this.end = num;
}
public void calc() {
for (int i = 0; i < end; i += 1) {
System.out.printf("%d ", a);
if (a == 0 || a == 1) {
System.out.printf("%n\\o_o/ Soy un 1 o 0. Soy especial%n");
}
c = a + b;
a = b;
b = c;
}
}
}

View File

@ -0,0 +1,5 @@
public class Main {
public static void main(String[] args) {
System.out.printf("Hello java");
}
}

6
api/hello_world/makefile Normal file
View File

@ -0,0 +1,6 @@
all:
javac Main.java
java Main
purge:
del /s /q *.class *.log *.tmp

19
api/import_self/Main.java Normal file
View File

@ -0,0 +1,19 @@
public class Main {
public static void main(String[] args) {
System.out.printf("Hello java %n");
Mod module = new Mod();
module.init();
}
}
class Mod {
public Mod() {
System.out.printf("Hello from import in self file%n");
}
public void init() {
System.out.printf("The init function%n");
}
}

6
api/import_self/makefile Normal file
View File

@ -0,0 +1,6 @@
all:
javac Main.java
java Main
purge:
del /s /q *.class *.log *.tmp

View File

View File

@ -0,0 +1,8 @@
all:
cd ./src && javac Main.java && java Main
latex:
pdflatex README.tex
clear:
del /s /q *.class *.log *.aux *.toc

View File

@ -0,0 +1,43 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
InputStreamReader inputStreamReader = new InputStreamReader(System.in);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
try {
System.out.printf("Ingresa el numero primo maximo: ");
String userInput = bufferedReader.readLine();
int userInputToInt = Integer.parseInt(userInput);
NumPrimos numPrimos = new NumPrimos();
for (int i = 0; i <= userInputToInt; i++) {
if (numPrimos.check(i)) {
System.out.printf("[%d]: Es un numero primo%n%n", i);
continue;
}
System.out.printf("[%d]: No es un numero primo%n", i);
}
} catch (IOException e) {
System.out.println("Ocurrio un error de entrada/salida:" + e.getMessage());
} catch (NumberFormatException e) {
System.out.println("Por favor, ingresa solo numeros validos.");
}
}
}
class NumPrimos {
public boolean check(int num) {
if (num <= 1) { return false; }
if (num == 2) { return true; }
for (int i = 2; i < num; i++) {
if (num % i == 0) { return false; }
}
return true;
}
}

0
api/package/makefile Normal file
View File

23
api/package/src/Main.java Normal file
View File

@ -0,0 +1,23 @@
import mod.Mod;
public class Main {
public static void main(String[] args) {
System.out.printf("%nMain.java: Hello java%n");
Module module = new Module();
module.init();
Mod mod = new Mod();
}
}
class Module {
public Module() {
System.out.printf("Module.java: Import from module%n");
}
public void init() {
System.out.printf("Module.java: The init function%n");
}
}

View File

@ -0,0 +1,7 @@
package mod;
public class Mod {
public Mod() {
System.out.printf("Mod.java: Import Module%n%n");
}
}

View File

@ -0,0 +1,45 @@
import java.util.Scanner;
public class Main {
public static void main(String [] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Input the temperature number:");
double temp_num = scan.nextDouble();
System.out.println("Input the convertion type: ");
System.out.println("1: Convert from Celsius to Fahrenheit");
System.out.println("2: Convert from Fahrenheit to Celsius");
int temperature_type = scan.nextInt();
Temperature tempe = new Temperature(temp_num);
switch (temperature_type) {
case 1:
System.out.println("(I) [" + temp_num + "°C] To " + tempe.toFahrenheit() + "°F");
break;
case 2:
System.out.println("(I) [" + temp_num + "°F] To " + tempe.toCelsius() + "°C");
break;
default:
System.out.println("Type number is not correct try again");
return;
}
}
}
class Temperature {
private double value;
public Temperature(double value) {
this.value = value;
}
public double toFahrenheit() {
return (value * 9 / 5) + 32;
}
public double toCelsius() {
return (value - 32) * 5 / 9;
}
}

View File

@ -1,7 +1,6 @@
purge: purge:
find . -name "*.class" -type f -delete find . -name "*.class" -type f -delete
# Windows Command Powershell: # Windows Command Powershell:
purge_windows: purge_windows:
powershell -Command "Get-ChildItem -Recurse -Include *.class,*.log,*.tmp,*~ | Remove-Item -Force" powershell -Command "Get-ChildItem -Recurse -Include *.class,*.log,*.tmp,*~ | Remove-Item -Force"

0
project/base_de_datos/makefile Executable file → Normal file
View File

0
project/cafeteria/README.tex Executable file → Normal file
View File

0
project/cafeteria/makefile Executable file → Normal file
View File

0
project/cafeteria/src/Main.java Executable file → Normal file
View File

0
project/cafeteria/src/cafeteria/Restaurante.java Executable file → Normal file
View File

0
project/cafeteria/src/cafeteria/clientela/Cliente.java Executable file → Normal file
View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

0
project/enjambre_de_langosta/README.md Executable file → Normal file
View File

0
project/enjambre_de_langosta/makefile Executable file → Normal file
View File

0
project/enjambre_de_langosta/src/com/Proy1.java Executable file → Normal file
View File

0
project/enjambre_de_langosta/src/com/mod/Init.java Executable file → Normal file
View File

View File

View File

0
project/juego_de_adivinanza_de_numeros/Main.java Executable file → Normal file
View File

0
project/juego_de_adivinanza_de_numeros/makefile Executable file → Normal file
View File

0
project/rompecabeza/Makefile Executable file → Normal file
View File

0
project/rompecabeza/src/com/Proy2.java Executable file → Normal file
View File

0
project/rompecabeza/src/com/mod/util/GameButton.java Executable file → Normal file
View File