Skip to content

Commit 86e9c4d

Browse files
authored
Merge branch 'mouredev:main' into raulG91
2 parents 45f6fb8 + 840fca8 commit 86e9c4d

File tree

48 files changed

+3900
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3900
-111
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
public class juanca2805 {
2+
3+
// Lenguaje elegido: Java https://www.java.com/es/
4+
/* Tipos de comentario
5+
que existen :)
6+
*/
7+
/*
8+
* Otro tipo de comentario
9+
*
10+
*/
11+
//Crear una variable y una constante si el lenguaje lo soporta
12+
public static void main(String[] args) throws Exception {
13+
14+
int Number = 3;
15+
String Cadena = "hola";
16+
boolean flag = false;
17+
18+
19+
// Constante
20+
final String constante = "Java!";
21+
22+
//Salida por consola
23+
24+
System.out.println(Cadena + " " + constante);
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Javascript website: https://www.javascript.com/
2+
3+
// Comentario en una linea
4+
5+
/*
6+
Comentario
7+
en
8+
multiples
9+
lineas
10+
*/
11+
12+
let myVariable;
13+
const myConst = 'Constante';
14+
15+
let myString = "Hola mundo!";
16+
let myOtherString = 'Hola mundo!';
17+
let myInt = 15;
18+
let myFloat = 23.50;
19+
let booleanTrue = true;
20+
let booleanFalse = false;
21+
let myArray = [ 15, 25, "A", "B"];
22+
let myObject = {name:"xNomada", edad:26, lenguaje:"Javascript"};
23+
let myUndefined = undefined;
24+
let nulo = null;
25+
let mySymbol = Symbol('Mi symbol');
26+
let myBigInt = 123456789012345678901234567890n;
27+
28+
console.log("Hola, Javascript!");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
* EJERCICIO:
2+
* - 1. Crea un comentario en el código y coloca la URL del sitio web oficial del
3+
* lenguaje de programación que has seleccionado.
4+
* - 2. Representa las diferentes sintaxis que existen de crear comentarios
5+
* en el lenguaje (en una línea, varias...).
6+
* - 3. Crea una variable (y una constante si el lenguaje lo soporta).
7+
* - 4. Crea variables representando todos los tipos de datos primitivos
8+
* del lenguaje (cadenas de texto, enteros, booleanos...).
9+
* - 5. Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!"
10+
*
11+
* ¿Fácil? No te preocupes, recuerda que esta es una ruta de estudio y
12+
* debemos comenzar por el principio.
13+
"""
14+
#1 este es solo un comentario
15+
16+
#3
17+
mi_variable = "variable constante"
18+
MI_VARIABLE = "No debe cambiar"
19+
20+
#4
21+
dato_string = "Python"
22+
dato_entero = 24
23+
dato_float = 24.5
24+
dato_booleano = True
25+
26+
#5
27+
print(f"hola {dato_string}")

Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/java/JesusAntonioEEscamilla.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,16 @@ public static void main(String[] args) {
191191
System.out.println("Este bloque se ejecuta siempre");
192192
}
193193

194-
/**-----DIFICULTAD EXTRA-----*/
194+
/**-----DIFICULTAD EXTRA-----*/
195195

196-
//Pendiente
196+
System.out.println("\n-----EXTRA-----\n");
197197

198-
/**-----DIFICULTAD EXTRA-----*/
198+
for(int m = 10; m < 55; m++){
199+
if ((m % 2 == 0) && (m != 16) && (m % 3 == 0)) {
200+
System.out.println(m);
201+
}
202+
}
203+
204+
/**-----DIFICULTAD EXTRA-----*/
199205
}
200206
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
public class juanca2805 {
2+
3+
public static void main(String[] args) {
4+
/*
5+
Operadores logicos
6+
*/
7+
int Numero1 = 5;
8+
int Numero2 = 7;
9+
10+
// operadores arigmeticos usados con variables y sin variables
11+
System.out.println( "LA SUMA DEl " + Numero1 + " + " + Numero2 + " es");
12+
System.out.println(Numero1 + Numero2);
13+
System.out.println("LA Resta DEl " + Numero1 + " + " + Numero2 + " es");
14+
System.out.println(Numero1 - Numero2);
15+
System.out.println(20 / 3);
16+
System.out.println(20 * 3);
17+
System.out.println(20 % 10);
18+
19+
//Operaciones de comparacion
20+
System.out.println(20 == 10);
21+
System.out.println(20 != 10);
22+
System.out.println(Numero1 > Numero2);
23+
System.out.println(Numero1 >= Numero2);
24+
25+
//operadores logicos
26+
boolean a;
27+
boolean b;
28+
29+
a = false;
30+
b = true;
31+
// Operador AND
32+
System.out.println("AND(&&): " + (a && b));
33+
// Operador OR
34+
a = true;
35+
b = false;
36+
System.out.println("OR(||): " + (a || b));
37+
// Operador NOT
38+
System.out.println("NOT(!): " + (!b));
39+
40+
//operador ternario
41+
int edad = 18;
42+
String mensaje = (edad >= 18) ? "Eres mayor de edad" : "Eres menor de edad";
43+
System.out.println(mensaje);
44+
45+
//operadores de asignacion
46+
Numero1 += 10;
47+
System.out.println(Numero1);
48+
//OPERADOR DE BITS
49+
System.out.println("Operadores de bits -------------------------------");
50+
51+
int cinco = 5; // 0101 en binario
52+
int tres =3; // 0011 en binario
53+
54+
int bitAnd = cinco & tres; // 0001 (1) Operación lógica AND
55+
System.out.println(bitAnd);
56+
int bitOr = cinco | tres; // 0111 (7) Operción lógica OR
57+
58+
System.out.println(bitOr);
59+
int bitXor = cinco ^ tres; // 0110 (6) Operación OR exclusiva
60+
System.out.println(bitXor);
61+
62+
/*Estructuras de control
63+
*
64+
* Condicionales
65+
*
66+
*
67+
*/
68+
69+
String Nombre = "camilo";
70+
71+
if (Nombre == "camilo") {
72+
System.out.println("Pase señor " + Nombre );
73+
}
74+
if (Nombre == "pepe") {
75+
System.out.println("usted no es bienvenido señor " + Nombre );
76+
}
77+
else{
78+
System.out.println("Usted no es el señor " + Nombre);
79+
}
80+
81+
// Iterativos
82+
83+
for(int i = 1; i <= 10 ; i++){
84+
System.out.print(" "+ i );
85+
};
86+
87+
extra();
88+
89+
90+
/* * DIFICULTAD EXTRA (opcional):
91+
Crea un programa que imprima por consola todos los números comprendidos
92+
entre 10 y 55 (incluidos), pares, y que no son ni el 16 ni múltiplos de 3.
93+
*/
94+
95+
96+
97+
}
98+
public static void extra() {
99+
for(int i = 10; i < 56; i++) {
100+
if((i != 16) && (i % 3 != 0) && (i % 2 == 0)) {
101+
System.out.println(i);
102+
}
103+
}
104+
}
105+
106+
107+
108+
109+
}
110+
111+
112+
113+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
* EJERCICIO:
3+
* - Crea ejemplos utilizando todos los tipos de operadores de tu lenguaje:
4+
* Aritméticos, lógicos, de comparación, asignación, identidad, pertenencia, bits...
5+
* (Ten en cuenta que cada lenguaje puede poseer unos diferentes)
6+
* - Utilizando las operaciones con operadores que tú quieras, crea ejemplos
7+
* que representen todos los tipos de estructuras de control que existan
8+
* en tu lenguaje:
9+
* Condicionales, iterativas, excepciones...
10+
* - Debes hacer print por consola del resultado de todos los ejemplos.
11+
*
12+
* DIFICULTAD EXTRA (opcional):
13+
* Crea un programa que imprima por consola todos los números comprendidos
14+
* entre 10 y 55 (incluidos), pares, y que no son ni el 16 ni múltiplos de 3.
15+
*
16+
* Seguro que al revisar detenidamente las posibilidades has descubierto algo nuevo.
17+
*/
18+
19+
// +++++++++ OPERADORES DE ASIGNACIÓN +++++++++
20+
x = y; // Asignación.
21+
x += y; // Asignación de adición: x = x + y
22+
x -= y; // Asinación de resta: x = x - y
23+
x *= y; // Asignación de multiplicación: x = x * y
24+
x /= y; // Asignación de multiplicación: x = x / y
25+
x %= y; // Asignación de residuo: x = x % y
26+
x **= y; // Asignación de exponenciación: x = x ** y
27+
x <<= y; // Asignación de desplazamiento a la izquierda: x = x << y
28+
x >>= y; // Asignación de desplazamiento a la derecha: x = x >> y
29+
x >>>= y; // Asignación de desplazamiento a la derecha sin signo: x = x >>> y
30+
x &= y; // Asignación AND bit a bit: x = x & y
31+
x ^= y; // Asignación XOR bit a bit
32+
x |= y; // Asignación OR bit a bit: x = x | y
33+
x && y; // Asignación AND lógico: x && (x = y)
34+
x ||= y; // Asignación OR lógico: x || (x = y)
35+
x ??= y; // Asignación de anulación lógica: x ?? (x = y)
36+
37+
// +++++++++ OPERADORES DE COMPARACIÓN +++++++++
38+
x == y; // Igual
39+
x != y; // No es igual
40+
x === y; // Estrictamente igual
41+
x !== y; // Desigualdad estricta
42+
x > y; // Mayor que
43+
x >= y; // Mayor o igual que
44+
x < y; // Menor que
45+
x <= y; // Menor o igual que
46+
47+
// +++++++++ OPERADORES ARITMÉTICOS +++++++++
48+
x + y; // Suma
49+
x - y; // Resta
50+
x * y; // Multiplicación
51+
x / y; // División
52+
x % y; // Residuo
53+
x++; // Incremento
54+
x--; // Decremento
55+
-x; // Negación unario
56+
+"3"; // Positivo unario
57+
x ** y; // Operador de exponenciación
58+
59+
// +++++++++ OPERADORES BIT A BIT +++++++++
60+
a & b; // AND a nivel de bits
61+
a | b; // OR a nivel de bits
62+
a ^ b; // XOR a nivel de bits
63+
~ a; // NOT a nivel de bits
64+
a << b; // Desplazamiento a la izquierda
65+
a >> b; // Desplazamiento a la derecha de propagación de signo
66+
a >>> b; // Desplazamiento a la derecha de relleno de cero
67+
68+
// +++++++++ OPERADORES LÓGICOS +++++++++
69+
true && x == x; // AND lógico
70+
true || x == y; // OR lógico
71+
!true; // NOT lógico
72+
73+
// +++++++++ OPERADORES DE CADENA +++++++++
74+
var myString = "Ra";
75+
myString + "úl"; // Concatenación
76+
myString += "úl"; // Concatenación por asignación abreviada
77+
78+
// +++++++++ OPERADOR CONDICIONAL (TERNARIO) +++++++++
79+
var status = age >= 18 ? "Adult" : "Minor";
80+
81+
// +++++++++ OPERADOR COMA +++++++++
82+
var x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
83+
var a = [x, x, x, x, x];
84+
85+
for (var i = 0, j = 9; i <= j; i++, j--) {
86+
console.log("a[" + i + "][" + j + "]= " + a[i][j]);
87+
}
88+
89+
// +++++++++ OPERADORES UNARIOS +++++++++
90+
z = 33;
91+
delete z; // Devuelve true si z se crea implícitamente
92+
typeof myString; // Devuelve "string"
93+
void (2 === "2"); // Devuelve undefined
94+
95+
// +++++++++ OPERADORES RELACIONALES +++++++++
96+
"PI" in Math; // Operador in
97+
var theDay = new Date(1995, 12, 17);
98+
if (theDay instanceof Date) { // Operador intanceof
99+
console.log("Si theDay es un objeto Date, las instrucciones de la expresión if se ejecutan.");
100+
}
101+
102+
// +++++++++ ESTRUCTURAS DE CONTROL +++++++++
103+
104+
// if / else if / else
105+
var firstName = "Samus";
106+
107+
if (firstName == "Samus") {
108+
console.log("Su nombre es Samus Aran.");
109+
} else if (firstName == "Adam") {
110+
console.log("Su nombre es Adam Malkovich.")
111+
} else {
112+
console.log("No hay registro del nombre.");
113+
}
114+
115+
// switch
116+
switch (2 + 2 === 4) {
117+
case true:
118+
console.log("La suma es correcta.");
119+
break;
120+
121+
case false:
122+
console.log("La suma es incorrecta.");
123+
124+
default:
125+
console.log("Error en la operación.");
126+
break;
127+
}
128+
129+
// while
130+
var iterationCount = 0;
131+
132+
while(iterationCount < 5) {
133+
iterationCount++;
134+
console.log("Número " + iterationCount);
135+
}
136+
137+
// do...while
138+
var iterationCount = 0;
139+
140+
do {
141+
iterationCount++;
142+
console.log("Número " + iterationCount);
143+
} while (iterationCount < 10);
144+
145+
// for
146+
for (let index = 0; index < 7; index++) {
147+
console.log("Número " + index);
148+
}
149+
150+
151+
// DIFICULTAD EXTRA
152+
for(index = 10; index <= 55; index++) {
153+
if (index !== 55) {
154+
if (index === 16 || index % 3 === 0 || index % 2 !== 0) {
155+
continue;
156+
}
157+
}
158+
159+
console.log("Número " + index);
160+
}

Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/python/JesusAntonioEEscamilla.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,6 @@
124124
"""
125125
EXTRA
126126
"""
127-
#Pendiente
127+
for num in range(10, 56):
128+
if num % 2 == 0 and num != 16 and num % 3 != 0:
129+
print(num)

0 commit comments

Comments
 (0)